OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2)=3, next primes are 5, 7, 11 and only 3+1+1 is prime, hence
a(3)=11, next primes are 13, 17, 19, 23 and only 1+1+2+3 is prime, hence a(4)=23, etc.
MATHEMATICA
lp[n_]:=Module[{p=NextPrime[n], tid=Total[IntegerDigits[n]]}, While[ CompositeQ[ Total[ IntegerDigits[p]]+tid], p=NextPrime[p]]; p]; NestList[ lp, 2, 60] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 30 2018 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov, Dec 12 2014
STATUS
approved