|
|
A053782
|
|
Numbers k such that the sum of the first k composite numbers is prime.
|
|
7
|
|
|
5, 14, 17, 20, 35, 36, 37, 43, 47, 48, 53, 54, 63, 64, 68, 73, 74, 75, 86, 101, 106, 127, 142, 149, 154, 159, 208, 209, 214, 221, 231, 234, 250, 254, 258, 259, 272, 283, 302, 304, 329, 332, 346, 352, 374, 398, 417, 424, 439, 440, 445, 458, 471, 550, 551, 556
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
MATHEMATICA
|
f[ n_Integer ] := Block[ {k = n + PrimePi[ n ] + 1}, While[ k - PrimePi[ k ] - 1 != n, k++ ]; k ]; s = 0; Do[ s = s + f[ n ]; If[ PrimeQ[ s ], Print[ n ] ], {n, 1, 1000} ]
With[{cn=Accumulate[Select[Range[1000], CompositeQ]]}, Position[cn, _?PrimeQ]]// Flatten (* Harvey P. Dale, Feb 09 2023 *)
|
|
PROG
|
(Python)
from sympy import isprime
A053782_list, n, m, s = [], 1, 4, 4
if isprime(s):
m += 1
if isprime(m):
m += 1
n += 1
(PARI) lista(nn) = {my(s = 0, nb = 0); forcomposite(c=1, nn, s += c; nb++; if (isprime(s), print1(nb, ", ")); ); } \\ Michel Marcus, May 13 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|