OFFSET
1,1
COMMENTS
A046704 is primes p with s(p) also prime. A207294 is primes p with s(p) and s(s(p)) also prime. A070027 is primes p with all s(p), s(s(p)), s(s(s(p))), ... also prime. A104213 is primes p with s(p) not prime. A213354 is primes p with s(p) and s(s(p)) also prime but s(s(s(p))) not prime. A213355 is smallest prime p whose k-fold digit sum s(s(..s(p)).)..)) is also prime for all k < n, but not for k = n.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
67 is prime and s(67) = 6+7 = 13 is also prime, but s(s(67)) = s(13) = 1+3 = 4 is not prime. Since no smaller prime has this property, a(1) = 67.
MAPLE
isA207293 := proc(n)
local d;
if isprime(n) then
d := digsum(n) ;
if isprime(d) then
d := digsum(d) ;
if isprime(d) then
false ;
else
true ;
end if;
else
false ;
end if;
else
false;
end if;
end proc:
A207293 := proc(n)
option remember ;
if n = 1 then
67 ;
else
a := nextprime(procname(n-1)) ;
while not isA207293(a) do
a := nextprime(a) ;
end do:
a ;
end if;
end proc: # R. J. Mathar, Feb 04 2021
MATHEMATICA
Select[Prime[Range[300]],
PrimeQ[Apply[Plus, IntegerDigits[#]]] && !
PrimeQ[Apply[Plus, IntegerDigits[Apply[Plus, IntegerDigits[#]]]]] &]
idsQ[n_]:=PrimeQ[Rest[NestList[Total[IntegerDigits[#]]&, n, 2]]]=={True, False}; Select[Prime[Range[200]], idsQ] (* Harvey P. Dale, Dec 28 2013 *)
PROG
(PARI) select(p->my(s=sumdigits(p)); isprime(s)&&!isprime(sumdigits(s)), primes(1000)) \\ Charles R Greathouse IV, Jun 10 2012
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jonathan Sondow, Jun 09 2012
STATUS
approved