Search: a013916 -id:a013916
|
|
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
|
|
|
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
|
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
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
|
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]
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
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
|
|
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
|
|
|
FORMULA
|
a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
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
|
|
MAPLE
|
s1:=[2]; for n from 2 to 1000 do s1:=[op(s1), s1[n-1]+ithprime(n)]; od: s1;
add(ithprime(i), i=1..n) ;
|
|
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
|
(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
(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))
|
|
CROSSREFS
|
Cf. A000041, A034386, A111287, A013916, A013918 (primes), A045345, A050247, A050248, A068873, A073619, A034387, A014148, A014150, A178138, A254784, A254858.
See A122989 for the value of Sum_{n >= 1} 1/a(n).
|
|
KEYWORD
|
nonn,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
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
|
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
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
|
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).
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
(Haskell)
a006562 n = a006562_list !! (n-1)
a006562_list = filter ((== 1) . a010051) a075540_list
(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
(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. A082077, A082078, A082079, A096697, A096698, A096699, A096700, A096701, A096702, A096703, A096704, A096693, A051634, A051635, A054342, A117078, A117563, A125830, A117876, A125576, A046869, A173891, A173892, A173893, A006560, A075540.
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Reworded comment and added formula from R. Eismann. - M. F. Hasler, Nov 30 2009
|
|
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
|
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
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
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
|
|
|
MAPLE
|
ListTools:-PartialSums(select(isprime, [seq(i, i=3..1000, 2)])); # Robert Israel, Feb 12 2017
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI) a(n) = sum(k=1, n+1, prime(k)) - 2; \\ Michel Marcus, Feb 12 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
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
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
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
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
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;
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
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
|
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.017 seconds
|