A207293 Primes p whose digit sum s(p) is also prime but whose iterated digit sum s(s(p)) is not prime.
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
Examples
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.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
PARI
select(p->my(s=sumdigits(p));isprime(s)&&!isprime(sumdigits(s)), primes(1000)) \\ Charles R Greathouse IV, Jun 10 2012
Comments