cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A245462 #23 Apr 25 2020 03:19:54
%S A245462 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 A245462 27,15,13,23,49,35,43,99,75,59,81,63,63,81,57,99,73,51,27,35,19,27,15,
%U A245462 23,27,17,25,51,49,35,27,29,99,71,45
%N 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.
%C A245462 A134855(n) = smallest odd k such that k*2^n+1 is prime, the primes are not always in increasing order.
%C A245462 Here the primes k*2^n+1 are always in increasing order.
%C A245462 The ratio sum{k for n=1 to N}/sum{n for n=1 to N} is ~ 2*log(2) as N increases.
%H A245462 Pierre CAMI, <a href="/A245462/b245462.txt">Table of n, a(n) for n = 1..6000</a>
%t A245462 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 A245462 (PFGW & SCRIPT)
%o A245462 SCRIPT
%o A245462 DIM j,-1
%o A245462 DIM n,0
%o A245462 DIMS t
%o A245462 OPENFILEOUT myf,a(n).txt
%o A245462 LABEL loop1
%o A245462 SET n,n+1
%o A245462 IF n>6000 THEN END
%o A245462 LABEL loop2
%o A245462 SET j,j+2
%o A245462 SETS t,%d,%d\,;n;j
%o A245462 PRP j*2^n+1,t
%o A245462 IF ISPRP THEN GOTO a
%o A245462 GOTO loop2
%o A245462 LABEL a
%o A245462 WRITE myf,t
%o A245462 SET j,j/2
%o A245462 IF j%2==0 THEN SET j,j+1
%o A245462 GOTO loop1
%o A245462 (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 A245462 Cf. A134855, A245441.
%K A245462 nonn
%O A245462 1,2
%A A245462 _Pierre CAMI_, Jul 22 2014