login
Indices of the Fermat primes in the sequence of primes.
8

%I #38 Sep 27 2024 07:22:06

%S 2,3,7,55,6543

%N Indices of the Fermat primes in the sequence of primes.

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

%H <a href="/index/Pri">Index entries for sequences that are related to primes dividing Fermat numbers</a>.

%F A098006(a(n)) = 0. - _Reinhard Zumkeller_, Mar 26 2013

%F a(n) = A000720(A019434(n)). - _Michel Marcus_, Apr 29 2021

%e 3, the 1st Fermat prime is the 2nd prime, so a(1) = 2.

%e 17, the 3rd Fermat prime is the 7th prime, so a(3) = 7.

%t PrimePi/@{3,5,17,257,65537} (* _Harvey P. Dale_, Aug 07 2022 *)

%o (Haskell)

%o import Data.List (elemIndices)

%o a159611 n = a159611_list !! (n-1)

%o a159611_list = map (+ 2) $ elemIndices 0 a098006_list

%o -- _Reinhard Zumkeller_, Mar 26 2013

%o (PARI) for(i=0, 10, isprime(f=2^2^i+1) & print1(primepi(f), ", ")) \\ _Michel Marcus_, Apr 28 2016

%o (PARI) a152155(n) = centerlift(Mod(3, 2^(2^n)+1)^(2^(2^n-1)))

%o print1(2, ", "); for(x=0, oo, if(a152155(x)==-1, print1(primepi(2^(2^x)+1), ", "))) \\ _Felix Fröhlich_, Apr 30 2021

%Y Cf. A000040 (primes), A000720, A019434 (Fermat primes).

%Y Cf. A098006.

%K nonn,hard

%O 1,1

%A _Walter Nissen_, Apr 16 2009

%E Name edited by _Felix Fröhlich_, Apr 30 2021