OFFSET
1,1
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..10000
EXAMPLE
1 + 2 = 3 that is a prime; 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 3 + 1 + 4 + 1 + 5 + 1 + 6 = 73 that is a prime.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, k, n; a:=0;
for n from 1 to q do b:=0; c:=n; for k from 1 to ilog10(n)+1 do b:=b+(c mod 10); c:=trunc(c/10); od; a:=a+b;
if isprime(a) then print(n); fi; od; end: P(10^4);
MATHEMATICA
Select[Range@ 1350, PrimeQ@ Total@ Map[Total@ IntegerDigits@ # &, Range@ #] &] (* Michael De Vlieger, Apr 11 2016 *)
PROG
(PARI) isok(n) = isprime(sum(k=1, n, sumdigits(k))); \\ Michel Marcus, Apr 11 2016
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Paolo P. Lava, Apr 11 2016
STATUS
approved