A239944 Smallest b > 0 making b^(2k) + b^k - 1 prime for k=1 through n.
2, 2, 2, 2, 460724, 610357585, 37748311920
Offset: 1
Keywords
Examples
a(5)=460724 means that for no integer k from 2 through 460723 does it hold that k^2n + k^n - 1 is prime for all n from 1 through 5, but for k=460724 this prime simultaneity occurs.
Programs
-
PARI
ok(b,n)=my(bk=1);for(k=1,n,bk*=b;if(!ispseudoprime(bk^2+bk-1),return(0)));b>0 a(n)=my(b=2); while(!is(b,n), b++); b \\ Charles R Greathouse IV, Apr 24 2014
-
PARI
\\ Reasonably efficient code, using precomputed modulus tables to speed the searches. diff(v)=vector(#v-1,i,v[i+1]-v[i]) ok(b,n)=my(bk=1);for(k=1,n,bk*=b;if(!ispseudoprime(bk^2+bk-1),return(0)));b>0 okMod(b,p,n)=for(k=1,n,my(m=Mod(b,p)^k);if(m^2+m==1,return(0)));1 lst(p,n)=select(b->okMod(b,p,n),[0..p-1]) makeU(lim,n)=my(v=[0],m=1,t);forprime(p=5,lim,t=lst(p);if(#t
Comments