A245462 a(1)=1, then a(n) is the smallest odd k > floor(a(n-1)/2)+1 such that k*2^n+1 is prime.
1, 3, 5, 7, 11, 7, 5, 13, 15, 13, 9, 15, 23, 39, 35, 21, 21, 33, 27, 25, 33, 25, 45, 45, 33, 27, 15, 13, 23, 49, 35, 43, 99, 75, 59, 81, 63, 63, 81, 57, 99, 73, 51, 27, 35, 19, 27, 15, 23, 27, 17, 25, 51, 49, 35, 27, 29, 99, 71, 45
Offset: 1
Keywords
Links
- Pierre CAMI, Table of n, a(n) for n = 1..6000
Programs
-
Mathematica
a[n_] := Block[{k = Floor[ a[n - 1]/2] + 2}, If[ EvenQ[k], k++]; While[ !PrimeQ[k*2^n + 1], k += 2]; k]; a[1] = 1; Array[a, 60] (* Robert G. Wilson v, Jul 26 2014 *)
-
PARI
a=[1]; for(n=2, 100, k=floor(a[n-1]/2)+2; if(k%2==0, k++); t=2^n; while(!isprime(k*t+1), k+=2); a=concat(a, k)); a \\ Colin Barker, Jul 23 2014
Comments