login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A139021 a(0)=2. a(n) = smallest prime > a(n-1) such that (Sum_{k=0..n} a(k)) is a power of a prime. 3

%I #19 Jan 13 2019 19:35:06

%S 2,3,11,13,227,307,461,463,2609,2683,58757,58831,137777,138007,

%T 17179469033,17179470433,240518567327,240518567479,

%U 19807040628566083882989513161,19807040628566083882989513433,324478939577169594614874645075239,324478939577169594614874645093097

%N a(0)=2. a(n) = smallest prime > a(n-1) such that (Sum_{k=0..n} a(k)) is a power of a prime.

%H Max Alekseyev, <a href="/A139021/b139021.txt">Table of n, a(n) for n = 0..31</a> (shortened by _N. J. A. Sloane_, Jan 13 2019)

%e The corresponding prime powers are 2 + 3 = 5^1, 2 + 3 + 11 = 2^4, 2 + 3 + 11 + 13 = 29^1, etc.

%p a := [2,3] ; while true do as := add(i,i=a) ; p := nextprime(op(-1,a)) ; while nops(numtheory[factorset](p+as)) > 1 do p := nextprime(p) ; od; a := [op(a),p] ; print(a) ; od: # _R. J. Mathar_, Apr 28 2008

%o (PARI) { printA139021() = my(a=2,s=2); print1(2,", "); for(n=2,100, if( s%2==0, until(isprimepower(s+a), a=nextprime(a+1)), t=log(s+a)\log(2) + 1; while( !ispseudoprime(2^t-s), t++); a=2^t-s; ); s+=a; print1(a,", ");); } /* _Max Alekseyev_, Oct 17 2015 */

%Y Cf. A139019, A139022.

%K nonn

%O 0,1

%A _Leroy Quet_, Apr 06 2008

%E 9 more terms from _R. J. Mathar_, Apr 28 2008

%E a(14)-a(19) from _Donovan Johnson_, Nov 26 2008

%E a(20)-a(21) from _Max Alekseyev_, Oct 14 2012

%E a(22)-a(31) in b-file from _Max Alekseyev_, Oct 17 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 6 21:56 EDT 2024. Contains 374058 sequences. (Running on oeis4.)