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!)
Search: a013916 -id:a013916
Displaying 1-10 of 37 results found. page 1 2 3 4
     Sort: relevance | references | number | modified | created      Format: long | short | data
A071149 Numbers n such that the sum of the first n odd primes (A071148) is prime; analogous to A013916. +20
4
1, 9, 15, 17, 53, 55, 61, 65, 71, 75, 95, 115, 117, 137, 141, 143, 155, 183, 191, 203, 249, 273, 275, 283, 291, 305, 339, 341, 377, 409, 411, 415, 435, 439, 449, 483, 495, 497, 509, 525, 583, 599, 605, 621, 633, 637, 643, 645, 671, 675, 709, 713, 715, 727 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = pi(A071150(n)). - Charles R Greathouse IV, May 13 2015
MAPLE
Primes:= select(isprime, [seq(2*i+1, i=1..10^4)]):
L:= ListTools:-PartialSums(Primes):
select(i -> isprime(L[i]), [$1..nops(L)]); # Robert Israel, May 19 2015
MATHEMATICA
Position[Accumulate@ Prime@ Range[2, 750], _?(PrimeQ@# &)] // Flatten (* Robert G. Wilson v, May 19 2015, after Harvey P. Dale in A013916 *)
PROG
(PARI) s=n=0; forprime(p=3, 1e4, n++; if(isprime(s+=p), print1(n", "))) \\ Charles R Greathouse IV, May 13 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 13 2002
STATUS
approved
A007504 Sum of the first n primes.
(Formerly M1370)
+10
494
0, 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - Hieronymus Fischer, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - Hieronymus Fischer, Oct 14 2012]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - M. F. Hasler, Mar 05 2014
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - Jinyuan Wang, Oct 04 2018
For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - Jianing Song, Nov 13 2022
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022
REFERENCES
E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
C. Axler, On a Sequence involving Prime Numbers, J. Int. Seq. 18 (2015) # 15.7.6.
Christian Axler, New bounds for the sum of the first n prime numbers, arXiv:1606.06874 [math.NT], 2016.
P. Hecht, Post-Quantum Cryptography: S_381 Cyclic Subgroup of High Order, International Journal of Advanced Engineering Research and Science (IJAERS, 2017) Vol. 4, Issue 6, 78-86.
Nilotpal Kanti Sinha, On the asymptotic expansion of the sum of the first n primes, arXiv:1011.1667 [math.NT], 2010-2015.
Lawrence C. Washington, Sums of Powers of Primes II, arXiv preprint (2022). arXiv:2209.12845 [math.NT]
Eric Weisstein's World of Mathematics, Prime Sums
FORMULA
a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
a(A051838(n)) = A002110(A051838(n)) / A116536(n). - Reinhard Zumkeller, Oct 03 2011
a(n) = min(A068873(n), A073619(n)) for n > 1. - Jonathan Sondow, Jul 10 2012
a(n) = A033286(n) - A152535(n). - Omar E. Pol, Aug 09 2012
For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - Vladimir Shevelev, Aug 01 2013
a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - Charles R Greathouse IV, Jun 11 2015
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = A008472(A002110(n)), for n > 0. - Michel Marcus, Jul 16 2020
MAPLE
s1:=[2]; for n from 2 to 1000 do s1:=[op(s1), s1[n-1]+ithprime(n)]; od: s1;
A007504 := proc(n)
add(ithprime(i), i=1..n) ;
end proc: # R. J. Mathar, Sep 20 2015
MATHEMATICA
Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
PROG
(PARI) A007504(n) = sum(k=1, n, prime(k)) \\ Michael B. Porter, Feb 26 2010
(PARI) a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
(Magma) [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
(Haskell)
a007504 n = a007504_list !! n
a007504_list = scanl (+) 0 a000040_list
-- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
(GAP) P:=Filtered([1..250], IsPrime);;
a:=Concatenation([0], List([1..Length(P)], i->Sum([1..i], k->P[k]))); # Muniru A Asiru, Oct 07 2018
(Python)
from itertools import accumulate, count, islice
from sympy import prime
def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
A007504_list = list(islice(A007504_gen(), 20)) # Chai Wah Wu, Feb 23 2022
CROSSREFS
See A122989 for the value of Sum_{n >= 1} 1/a(n).
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014
STATUS
approved
A006562 Balanced primes (of order one): primes which are the average of the previous prime and the following prime.
(Formerly M4011)
+10
144
5, 53, 157, 173, 211, 257, 263, 373, 563, 593, 607, 653, 733, 947, 977, 1103, 1123, 1187, 1223, 1367, 1511, 1747, 1753, 1907, 2287, 2417, 2677, 2903, 2963, 3307, 3313, 3637, 3733, 4013, 4409, 4457, 4597, 4657, 4691, 4993, 5107, 5113, 5303, 5387, 5393 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Subsequence of A075540. - Franklin T. Adams-Watters, Jan 11 2006
This subsequence of A125830 and of A162174 gives primes of level (1,1): More generally, the i-th prime p(i) is of level (1,k) if and only if it has level 1 in A117563 and 2 p(i) - p(i+1) = p(i-k). - Rémi Eismann, Feb 15 2007
Note the similarity between plots of A006562 and A013916. - Bill McEachen, Sep 07 2009
Balanced primes U strong primes = good primes. Or, A006562 U A051634 = A046869. - Juri-Stepan Gerasimov, Mar 01 2010
Primes prime(n) such that A001223(n-1) = A001223(n). - Irina Gerasimova, Jul 11 2013
Numbers m such that A346399(m) is odd and >= 3. - Ya-Ping Lu, Dec 26 2021 and May 07 2024
REFERENCES
A. Murthy, Smarandache Notions Journal, Vol. 11 N. 1-2-3 Spring 2000.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.
LINKS
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972, p. 870.
Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
Shubhankar Paul, Ten Problems of Number Theory, International Journal of Engineering and Technical Research (IJETR), ISSN: 2321-0869, Volume-1, Issue-9, November 2013.
Shubhankar Paul, Legendre, Grimm, Balanced Prime, Prime triple, Polignac's conjecture, a problem and 17 tips with proof to solve problems on number theory, International Journal of Engineering and Technical Research (IJETR), ISSN: 2321-0869, Volume-1, Issue-10, December 2013.
FORMULA
2*p_n = p_(n-1) + p_(n+1).
Equals { p = prime(k) | A118534(k) = prime(k-1) }. - Rémi Eismann, Nov 30 2009
a(n) = A000040(A064113(n) + 1) = (A122535(n) + A181424(n)) / 2. - Reinhard Zumkeller, Jan 20 2012
a(n) = A122535(n) + A117217(n). - Zak Seidov, Feb 14 2013
Equals A145025 intersect A000040 = A145025 \ A024675. - M. F. Hasler, Jun 01 2013
Conjecture: Limit_{n->oo} n*(log(a(n)))^2 / a(n) = 1/2. - Alain Rocchelli, Mar 21 2024
Conjecture: The asymptotic limit of the average of a(n+1)-a(n) is equivalent to 2*(log(a(n)))^2. Otherwise formulated: 2 * Sum_{n=1..N} (log(a(n)))^2 ~ a(N). - Alain Rocchelli, Mar 23 2024
EXAMPLE
5 belongs to the sequence because 5 = (3 + 7)/2. Likewise 53 = (47 + 59)/2.
5 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (3, 5, 7).
53 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (47, 53, 59).
257 and 263 belong to the sequence because they are terms, but not first or last, of the AP of consecutive primes (251, 257, 263, 269).
MATHEMATICA
Transpose[ Select[ Partition[ Prime[ Range[1000]], 3, 1], #[[2]] ==(#[[1]] + #[[3]])/2 &]][[2]]
p=Prime[Range[1000]]; p[[Flatten[1+Position[Differences[p, 2], 0]]]]
Prime[#]&/@SequencePosition[Differences[Prime[Range[800]]], {x_, x_}][[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 31 2019 *)
PROG
(PARI) betwixtpr(n) = { local(c1, c2, x, y); for(x=2, n, c1=c2=0; for(y=prime(x-1)+1, prime(x)-1, if(!isprime(y), c1++); ); for(y=prime(x)+1, prime(x+1)-1, if(!isprime(y), c2++); ); if(c1==c2, print1(prime(x)", ")) ) } \\ Cino Hilliard, Jan 25 2005
(PARI) forprime(n=1, 999, n-precprime(n-1)==nextprime(n+1)-n&print1(n", ")) \\ M. F. Hasler, Jun 01 2013
(PARI) is(n)=n-precprime(n-1)==nextprime(n+1)-n && isprime(n) \\ Charles R Greathouse IV, Apr 07 2016
(Haskell)
a006562 n = a006562_list !! (n-1)
a006562_list = filter ((== 1) . a010051) a075540_list
-- Reinhard Zumkeller, Jan 20 2012
(Haskell)
a006562 n = a006562_list !! (n-1)
a006562_list = h a000040_list where
h (p:qs@(q:r:ps)) = if 2 * q == (p + r) then q : h qs else h qs
-- Reinhard Zumkeller, May 09 2013
(Magma) [a: n in [1..1000] | IsPrime(a) where a is NthPrime(n)-NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
(Python)
from sympy import nextprime; p, q, r = 2, 3, 5
while q < 6000:
if 2*q == p + r: print(q, end = ", ")
p, q, r = q, r, nextprime(r) # Ya-Ping Lu, Dec 23 2021
CROSSREFS
Cf. A225494 (multiplicative closure); complement of A178943 with respect to A000040.
Cf. A055380, A051795, A081415, A096710 for other balanced prime sequences.
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Reworded comment and added formula from R. Eismann. - M. F. Hasler, Nov 30 2009
Edited by Daniel Forgues, Jan 15 2011
STATUS
approved
A013918 Primes equal to the sum of the first k primes for some k. +10
47
2, 5, 17, 41, 197, 281, 7699, 8893, 22039, 24133, 25237, 28697, 32353, 37561, 38921, 43201, 44683, 55837, 61027, 66463, 70241, 86453, 102001, 109147, 116533, 119069, 121631, 129419, 132059, 263171, 287137, 325019, 329401, 333821, 338279, 342761 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Intersection of A000040 and A007504. - David W. Wilson, May 11 2007
Sum of the first k primes p_1+p_2+...+p_k is in the sequence if and only if there exists the prime q for which p_i divides p_1+p_2+...+p_k+q for all i to k. - Vladimir Letsko, Oct 13 2013
LINKS
Vladimir Letsko, Mathematical Marathon, problem 124 (in Russian).
FORMULA
a(n) = A007504(A013916(n)).
MATHEMATICA
Select[Accumulate[Prime[Range[1000]]], PrimeQ] (* Vladimir Joseph Stephan Orlovsky, Sep 01 2008 *)
PROG
(PARI) n=0; forprime(k=2, 2300, n=n+k; if(isprime(n), print(n))) \\ Michael B. Porter, Jan 29 2010
(Haskell)
a013918 n = a013918_list !! (n-1)
a013918_list = filter ((== 1) . a010051) a007504_list
-- Reinhard Zumkeller, Feb 09 2015
CROSSREFS
Cf. A013916, A013917, A189153 (number of these primes < 10^n).
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Renaud Lifchitz (100637.64(AT)CompuServe.COM)
EXTENSIONS
More terms from David W. Wilson
STATUS
approved
A071148 Partial sums of sequence of odd primes (A065091); a(n) = sum of the first n odd primes. +10
47
3, 8, 15, 26, 39, 56, 75, 98, 127, 158, 195, 236, 279, 326, 379, 438, 499, 566, 637, 710, 789, 872, 961, 1058, 1159, 1262, 1369, 1478, 1591, 1718, 1849, 1986, 2125, 2274, 2425, 2582, 2745, 2912, 3085, 3264, 3445, 3636, 3829, 4026, 4225, 4436, 4659, 4886 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A007504(n+1) - 2.
MAPLE
ListTools:-PartialSums(select(isprime, [seq(i, i=3..1000, 2)])); # Robert Israel, Feb 12 2017
MATHEMATICA
Accumulate@ Prime@ Range[2, 49] (* Michael De Vlieger, Feb 12 2017 *)
PROG
(PARI) a(n) = sum(k=1, n+1, prime(k)) - 2; \\ Michel Marcus, Feb 12 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, May 13 2002
STATUS
approved
A013917 a(n) is prime and sum of all primes <= a(n) is prime. +10
12
2, 3, 7, 13, 37, 43, 281, 311, 503, 541, 557, 593, 619, 673, 683, 733, 743, 839, 881, 929, 953, 1061, 1163, 1213, 1249, 1277, 1283, 1307, 1321, 1949, 2029, 2161, 2203, 2213, 2237, 2243, 2297, 2357, 2393, 2411, 2957, 3137, 3251, 3257, 3301, 3413, 3461, 3491 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A000040(A013916(n)).
MATHEMATICA
Prime[Flatten[Position[Accumulate[Prime[Range[500]]], _?PrimeQ]]] (* Jayanta Basu, May 18 2013 *)
PROG
(PARI) isA013917(n) = isprime(n) && isprime(sum(i=2, n, isprime(i)*i)) \\ Michael B. Porter, Jan 29 2010
(PARI) list(lim)=my(v=List(), s); forprime(p=2, lim, if(isprime(s+=p), listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Oct 19 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Renaud Lifchitz (100637.64(AT)CompuServe.COM)
EXTENSIONS
More terms from David W. Wilson
STATUS
approved
A098561 Numbers n such that the sum of the squares of the first n primes is prime. +10
12
2, 18, 26, 36, 68, 78, 144, 158, 164, 174, 192, 212, 216, 236, 264, 288, 294, 338, 344, 356, 384, 404, 416, 426, 500, 516, 518, 522, 534, 540, 548, 614, 678, 680, 782, 858, 866, 876, 878, 896, 900, 912, 950, 974, 996, 1064, 1080, 1082, 1100, 1122, 1158, 1160 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) must clearly be even.
LINKS
EXAMPLE
2 is a term as the sum of the squares of the first two primes is 2^2 + 3^2 = 13, which is prime.
MATHEMATICA
Select[Range[1000], PrimeQ[Sum[Prime[i]^2, {i, #}]] &] (* Carl Najafi, Aug 22 2011 *)
CROSSREFS
Cf. A098562 (corresponding primes), A024450 (sums of squares of primes), A098563 (sums of cubes of primes), A013916 (sums of primes).
KEYWORD
nonn
AUTHOR
Rick L. Shepherd, Sep 14 2004
STATUS
approved
A089228 Numbers m such that 1 + Sum_{k=1..m} prime(k) is prime. +10
5
1, 3, 5, 7, 9, 13, 19, 25, 29, 31, 49, 51, 57, 97, 99, 103, 109, 119, 123, 127, 163, 169, 179, 185, 195, 207, 209, 211, 213, 217, 221, 223, 233, 235, 239, 251, 261, 269, 273, 289, 295, 297, 303, 325, 329, 333, 347, 369, 371, 375, 409, 439, 449, 453, 455, 467 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Also numbers n such that the sum of the first n "primes", as defined in A008578, is prime. Analogous to A013916. - Robert G. Wilson v, May 19 2015
Integers k such that A007504(k) + 1 is prime. - Michel Marcus, Aug 10 2023
LINKS
EXAMPLE
25 is a term: 1 + Sum_{k=1..25} prime(k) = 1061 is prime.
MAPLE
a:=proc(n) if isprime(1+add(ithprime(k), k=1..n))=true then n else fi end: seq(a(n), n=1..600); # Emeric Deutsch, Jul 02 2005
# alternative
Primes:= select(isprime, [2, seq(2*i+1, i=1..10^5)]):
PS:= ListTools:-PartialSums(Primes):
select(t -> isprime(PS[t]+1), [$1..nops(PS)]); # Robert Israel, May 19 2015
MATHEMATICA
Position[1 + Accumulate@ Prime@ Range@ 600, _?(PrimeQ@# &)] // Flatten (* after Harvey P. Dale from A013916 *) (* Robert G. Wilson v, May 19 2015 *)
PROG
(PARI) for(n=1, 10^3, if(isprime(1+sum(i=1, n, prime(i))), print1(n, ", "))) \\ Derek Orr, May 19 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Yalcin Aktar, Dec 10 2003
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jul 02 2005
STATUS
approved
A071150 Primes p such that the sum of all odd primes <= p is also a prime. +10
4
3, 29, 53, 61, 251, 263, 293, 317, 359, 383, 503, 641, 647, 787, 821, 827, 911, 1097, 1163, 1249, 1583, 1759, 1783, 1861, 1907, 2017, 2287, 2297, 2593, 2819, 2837, 2861, 3041, 3079, 3181, 3461, 3541, 3557, 3643, 3779, 4259, 4409, 4457, 4597, 4691, 4729, 4789 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
29 is a prime and 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 = 127 (also a prime), so 29 is a term. - Jon E. Schoenfield, Mar 29 2021
MAPLE
SoddP := proc(n)
option remember;
if n <= 2 then
0;
elif isprime(n) then
procname(n-1)+n;
else
procname(n-1);
fi ;
end proc:
isA071150 := proc(n)
if isprime(n) and isprime(SoddP(n)) then
true;
else
false;
end if;
end proc:
n := 1 ;
for i from 3 by 2 do
if isA071150(i) then
printf("%d %d\n", n, i) ;
n := n+1 ;
end if;
end do: # R. J. Mathar, Feb 13 2015
MATHEMATICA
Function[s, Select[Array[Take[s, #] &, Length@ s], PrimeQ@ Total@ # &][[All, -1]]]@ Prime@ Range[2, 640] (* Michael De Vlieger, Jul 18 2017 *)
Module[{nn=650, pr}, pr=Prime[Range[2, nn]]; Table[If[PrimeQ[Total[Take[ pr, n]]], pr[[n]], Nothing], {n, nn-1}]] (* Harvey P. Dale, May 12 2018 *)
PROG
(Python)
from sympy import isprime, nextprime
def aupto(limit):
p, s, alst = 3, 3, []
while p <= limit:
if isprime(s): alst.append(p)
p = nextprime(p)
s += p
return alst
print(aupto(4789)) # Michael S. Branicky, Mar 29 2021
CROSSREFS
Analogous to A013917.
KEYWORD
easy,nonn
AUTHOR
Labos Elemer, May 13 2002
STATUS
approved
A071151 Primes which are the sum of the first k odd primes for some k. +10
4
3, 127, 379, 499, 6079, 6599, 8273, 9521, 11597, 13099, 22037, 33623, 34913, 49279, 52517, 54167, 64613, 92951, 101999, 116531, 182107, 222269, 225829, 240379, 255443, 283079, 356387, 360977, 448867, 535669, 541339, 552751, 611953, 624209 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MATHEMATICA
s=0; lst={}; Do[p=Prime[n]; s+=p; If[PrimeQ[s], AppendTo[lst, s]], {n, 2, 7!}]; lst (* Vladimir Joseph Stephan Orlovsky, Jan 28 2009 *)
Select[Accumulate[Prime[Range[2, 500]]], PrimeQ] (* Harvey P. Dale, Mar 14 2011 *)
PROG
(PARI) list(lim)=my(v=List(), s); forprime(p=3, , if((s+=p)>lim, return(Vec(v))); if(isprime(s), listput(v, s))) \\ Charles R Greathouse IV, May 22 2017
CROSSREFS
Analogous to A013918.
KEYWORD
nonn
AUTHOR
Labos Elemer, May 13 2002
EXTENSIONS
Name simplified by Charles R Greathouse IV, May 22 2017
STATUS
approved
page 1 2 3 4

Search completed in 0.017 seconds

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 22 11:48 EDT 2024. Contains 374499 sequences. (Running on oeis4.)