cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A207293 Primes p whose digit sum s(p) is also prime but whose iterated digit sum s(s(p)) is not prime.

This page as a plain text file.
%I A207293 #22 Feb 18 2025 03:50:42
%S A207293 67,89,139,157,179,193,197,199,229,269,283,337,359,373,379,397,409,
%T A207293 449,463,467,487,557,571,577,593,607,643,647,661,683,719,733,739,751,
%U A207293 757,773,809,823,827,829,863,881,883,919,937,953,971,991,1039,1093,1097,1129,1187
%N A207293 Primes p whose digit sum s(p) is also prime but whose iterated digit sum s(s(p)) is not prime.
%C A207293 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.
%H A207293 Charles R Greathouse IV, <a href="/A207293/b207293.txt">Table of n, a(n) for n = 1..10000</a>
%e A207293 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.
%p A207293 isA207293 := proc(n)
%p A207293     local d;
%p A207293     if isprime(n) then
%p A207293         d := digsum(n) ;
%p A207293         if isprime(d) then
%p A207293             d := digsum(d) ;
%p A207293             if isprime(d) then
%p A207293                 false ;
%p A207293             else
%p A207293                 true ;
%p A207293             end if;
%p A207293         else
%p A207293             false ;
%p A207293         end if;
%p A207293     else
%p A207293         false;
%p A207293     end if;
%p A207293 end proc:
%p A207293 A207293 := proc(n)
%p A207293     option remember ;
%p A207293     if n = 1 then
%p A207293         67 ;
%p A207293     else
%p A207293         a := nextprime(procname(n-1)) ;
%p A207293         while not isA207293(a) do
%p A207293             a := nextprime(a) ;
%p A207293         end do:
%p A207293         a ;
%p A207293     end if;
%p A207293 end proc: # _R. J. Mathar_, Feb 04 2021
%t A207293 Select[Prime[Range[300]],
%t A207293 PrimeQ[Apply[Plus, IntegerDigits[#]]] && !
%t A207293     PrimeQ[Apply[Plus, IntegerDigits[Apply[Plus, IntegerDigits[#]]]]] &]
%t A207293 idsQ[n_]:=PrimeQ[Rest[NestList[Total[IntegerDigits[#]]&,n,2]]]=={True,False}; Select[Prime[Range[200]],idsQ] (* _Harvey P. Dale_, Dec 28 2013 *)
%o A207293 (PARI) select(p->my(s=sumdigits(p));isprime(s)&&!isprime(sumdigits(s)), primes(1000)) \\ _Charles R Greathouse IV_, Jun 10 2012
%Y A207293 Cf. A046704, A070027, A104213, A207294, A213354, A213355.
%K A207293 base,nonn
%O A207293 1,1
%A A207293 _Jonathan Sondow_, Jun 09 2012