login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
2, 3, 11, 13, 227, 307, 461, 463, 2609, 2683, 58757, 58831, 137777, 138007, 17179469033, 17179470433, 240518567327, 240518567479, 19807040628566083882989513161, 19807040628566083882989513433, 324478939577169594614874645075239, 324478939577169594614874645093097
OFFSET
0,1
LINKS
Max Alekseyev, Table of n, a(n) for n = 0..31 (shortened by N. J. A. Sloane, Jan 13 2019)
EXAMPLE
The corresponding prime powers are 2 + 3 = 5^1, 2 + 3 + 11 = 2^4, 2 + 3 + 11 + 13 = 29^1, etc.
MAPLE
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
PROG
(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 */
CROSSREFS
Sequence in context: A139052 A076491 A105226 * A176038 A293827 A145771
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 06 2008
EXTENSIONS
9 more terms from R. J. Mathar, Apr 28 2008
a(14)-a(19) from Donovan Johnson, Nov 26 2008
a(20)-a(21) from Max Alekseyev, Oct 14 2012
a(22)-a(31) in b-file from Max Alekseyev, Oct 17 2015
STATUS
approved