OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
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
while len(A053782_list) < 10000:
if isprime(s):
A053782_list.append(n)
m += 1
if isprime(m):
m += 1
n += 1
s += m # Chai Wah Wu, May 13 2018
(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
G. L. Honaker, Jr., Mar 30 2000
EXTENSIONS
More terms from Robert G. Wilson v, Mar 22 2001
STATUS
approved