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.

Showing 1-1 of 1 results.

A084435 a(1) = 2, then smallest prime of the form 2^k*a(n-1) + 1.

Original entry on oeis.org

2, 3, 7, 29, 59, 1889, 3779, 7559, 4058207223809, 32465657790473, 4462046030502692971872257, 9582170887127842377060195852353537
Offset: 1

Views

Author

Amarnath Murthy, Jun 03 2003

Keywords

Comments

This sequence also is generated when the initial term is 1. It is unclear if the sequence is finite or infinite. - Bob Selcoe, Oct 09 2015

Examples

			a(3)=7 because 3*2+1=7 is prime;
a(4)=29 because 7*2+1=15 is not prime, 7*4+1=29 is prime.
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 2, Seminumerical Algorithms, problem 39, page 76.

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{k = 0, p = s[[-1]]}, While[q = 2^k*p + 1; !PrimeQ[ q], k++]; Append[s, q]]; s = {2}; Nest[f, s, 16] (* Robert G. Wilson v, Mar 11 2015 *)
  • PARI
    lista(nn) = {a = 2; print1(a, ", "); for (n=1, nn, k=0; while (!isprime(2^k*a+1), k++); a = 2^k*a+1; print1(a, ", "););} \\ Michel Marcus, Mar 18 2015
Showing 1-1 of 1 results.