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.

Original entry on oeis.org

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

Views

Author

Pierre CAMI, Jul 22 2014

Keywords

Comments

A134855(n) = smallest odd k such that k*2^n+1 is prime, the primes are not always in increasing order.
Here the primes k*2^n+1 are always in increasing order.
The ratio sum{k for n=1 to N}/sum{n for n=1 to N} is ~ 2*log(2) as N increases.

Crossrefs

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