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.

A228021 Prime(k) such that 2^(k - 1) + prime(k) is also prime.

This page as a plain text file.
%I A228021 #30 Apr 16 2025 19:40:19
%S A228021 2,3,29,89,251,659,937,1307,1453,8179,9391,12097,28499,83969,101209,
%T A228021 120739,730993
%N A228021 Prime(k) such that 2^(k - 1) + prime(k) is also prime.
%C A228021 The primes indices k are 1, 2, 10, 24, 54, 120, 159, 214, 231, 1027, 1161, 1447, 3100, 8188, 9695, 11363 ...
%C A228021 The corresponding primes 2^(k - 1) + prime(k) are 3, 5, 541, 8388697,...
%C A228021 a(18) > 2*10^6. - _Michael S. Branicky_, Apr 16 2025
%e A228021 29 is in the sequence because 29 = prime(10) and 2^(10 - 1) + 29 = 512 + 29 = 541 is prime.
%p A228021 for i from 1 do
%p A228021     p := ithprime(i) ;
%p A228021     if isprime(p+2^(i-1)) then
%p A228021        printf("%d,\n",p) ;
%p A228021     end if;
%p A228021 end do: # _R. J. Mathar_, Jul 12 2014
%t A228021 p = 2; lst = {}; While[p < 730001, If[ PrimeQ[ 2^(PrimePi@ p-1) + p], AppendTo[lst, p]; Print@ p]; p = NextPrime@ p]; lst (* _Robert G. Wilson v_, Jul 09 2014 *)
%o A228021 (PARI) lista(nn) = {ip = 1; forprime(p=2, nn, if (isprime(2^(ip-1)+p), print1(p, ", ")); ip++;);} \\ _Michel Marcus_, Jul 12 2014
%Y A228021 Cf. A077375, A227126, A242944, A244913, A244916.
%K A228021 nonn,hard,more
%O A228021 1,1
%A A228021 _Juri-Stepan Gerasimov_, Aug 03 2013
%E A228021 a(3) - a(9) from __Olivier Gérard__, Aug 01 2013
%E A228021 a(10) - a(15) from _Robert G. Wilson v_, Aug 01 2013
%E A228021 a(16) from _Robert G. Wilson v_, Jul 09 2014
%E A228021 a(17) from _Michael S. Branicky_, Apr 14 2025