|
|
A104247
|
|
Primes that are the sum of digits of the first k primes for some k.
|
|
3
|
|
|
2, 5, 17, 19, 23, 31, 41, 61, 71, 83, 181, 269, 389, 419, 449, 631, 683, 727, 743, 809, 929, 1039, 1061, 1069, 1091, 1277, 1381, 1481, 1567, 1613, 1747, 1873, 1951, 1993, 2039, 2129, 2281, 2297, 2339, 2381, 2549, 2579
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|