login
A207293
Primes p whose digit sum s(p) is also prime but whose iterated digit sum s(s(p)) is not prime.
5
67, 89, 139, 157, 179, 193, 197, 199, 229, 269, 283, 337, 359, 373, 379, 397, 409, 449, 463, 467, 487, 557, 571, 577, 593, 607, 643, 647, 661, 683, 719, 733, 739, 751, 757, 773, 809, 823, 827, 829, 863, 881, 883, 919, 937, 953, 971, 991, 1039, 1093, 1097, 1129, 1187
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