View Single Post
Old 2011-03-07, 23:53   #22
Batalov's Avatar
Mar 2008

999110 Posts

Unsurprisingly, there were no counterexamples up to p<1450.
A modified one-liner
forprime(p=2,3000,if(!isprime(n=2^p-1),print(p);for(a=1,p-1,for(b=0,a-1,x=2^a+2^b;c=x;for(i=3,p,c=(c^2*x)%n);if((c^2)%n==1,print("found: a="a", b="b))))))
can run without need to skip prime Mp's and can run forever lazily...

A bit faster:
forprime(p=2,3000,if(!isprime(n=2^p-1),print(p);for(a=1,p-1,for(b=0,a-1,x=(2^a+2^b)%n;x2=(x^2)%n;c=x;for(i=1,p,c=(c^2)%n);if(c==x2,print("found: a="a", b="b))))))

...Is there a better mod exponent in Pari? Mod(2^a+2^b,n)^n ?

Last fiddled with by Batalov on 2011-03-08 at 00:09 Reason: (not a master of Pari, I am)
Batalov is offline   Reply With Quote