login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #23 Apr 25 2020 03:19:54

%S 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,

%T 27,15,13,23,49,35,43,99,75,59,81,63,63,81,57,99,73,51,27,35,19,27,15,

%U 23,27,17,25,51,49,35,27,29,99,71,45

%N 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.

%C A134855(n) = smallest odd k such that k*2^n+1 is prime, the primes are not always in increasing order.

%C Here the primes k*2^n+1 are always in increasing order.

%C The ratio sum{k for n=1 to N}/sum{n for n=1 to N} is ~ 2*log(2) as N increases.

%H Pierre CAMI, <a href="/A245462/b245462.txt">Table of n, a(n) for n = 1..6000</a>

%t 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 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM j,-1

%o DIM n,0

%o DIMS t

%o OPENFILEOUT myf,a(n).txt

%o LABEL loop1

%o SET n,n+1

%o IF n>6000 THEN END

%o LABEL loop2

%o SET j,j+2

%o SETS t,%d,%d\,;n;j

%o PRP j*2^n+1,t

%o IF ISPRP THEN GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf,t

%o SET j,j/2

%o IF j%2==0 THEN SET j,j+1

%o GOTO loop1

%o (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

%Y Cf. A134855, A245441.

%K nonn

%O 1,2

%A _Pierre CAMI_, Jul 22 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 08:33 EDT 2024. Contains 371905 sequences. (Running on oeis4.)