OFFSET
1,1
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..1000
EXAMPLE
a(4)=19 because A058049(4)= 5 and sum of digits of the first 5 primes, 2+3+5+7+(1+1)=19 is prime.
PROG
(Python)
from sympy import isprime, nextprime
def sd(n): return sum(map(int, str(n)))
def aupto(limit):
alst, k, p, s = [], 1, 2, 2
while s <= limit:
if isprime(s): alst.append(s)
k += 1; p = nextprime(p); s += sd(p)
return alst
print(aupto(2579)) # Michael S. Branicky, Jul 18 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Feb 26 2005
STATUS
approved