|
|
A058846
|
|
Numbers k such that the sum of odd primes up to k is palindromic.
|
|
3
|
|
|
3, 5, 229, 257, 1031, 7213, 11863, 133853, 1002073, 31924583, 97137589, 1837875227
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Sum is 3 + 5 + 7 + 11 + 13 + 17 + ... + k.
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(PARI) lista(nn) = {s = 0; p = 2; for (n=1, nn, p = nextprime(p+1); s += p; d = digits(s); if (Vecrev(d) == d, print1(p, ", ")); ); } \\ Michel Marcus, Aug 09 2017
(Python)
from sympy import primerange
def ispal(n): s = str(n); return s == s[::-1]
def afind(limit):
s = 0
for p in primerange(3, limit):
s += p
if ispal(s): print(p, end=", ")
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|