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.

A159611 Indices of the Fermat primes in the sequence of primes.

Original entry on oeis.org

2, 3, 7, 55, 6543
Offset: 1

Views

Author

Walter Nissen, Apr 16 2009

Keywords

Comments

If it exists, a(6) >= primepi(2^(2^33)+1) which has more than 2*10^9 decimal digits. - Amiram Eldar, Sep 27 2024

Examples

			3, the 1st Fermat prime is the 2nd prime, so a(1) = 2.
17, the 3rd Fermat prime is the 7th prime, so a(3) = 7.
		

Crossrefs

Cf. A000040 (primes), A000720, A019434 (Fermat primes).
Cf. A098006.

Programs

  • Haskell
    import Data.List (elemIndices)
    a159611 n = a159611_list !! (n-1)
    a159611_list = map (+ 2) $ elemIndices 0 a098006_list
    -- Reinhard Zumkeller, Mar 26 2013
    
  • Mathematica
    PrimePi/@{3,5,17,257,65537} (* Harvey P. Dale, Aug 07 2022 *)
  • PARI
    for(i=0, 10, isprime(f=2^2^i+1) & print1(primepi(f), ", ")) \\ Michel Marcus, Apr 28 2016
    
  • PARI
    a152155(n) = centerlift(Mod(3, 2^(2^n)+1)^(2^(2^n-1)))
    print1(2, ", "); for(x=0, oo, if(a152155(x)==-1, print1(primepi(2^(2^x)+1), ", "))) \\ Felix Fröhlich, Apr 30 2021

Formula

A098006(a(n)) = 0. - Reinhard Zumkeller, Mar 26 2013
a(n) = A000720(A019434(n)). - Michel Marcus, Apr 29 2021

Extensions

Name edited by Felix Fröhlich, Apr 30 2021