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.

A062088 Primes with every digit a prime and the sum of the digits a prime.

This page as a plain text file.
%I A062088 #25 Sep 23 2022 16:39:09
%S A062088 2,3,5,7,23,223,227,337,353,373,557,577,733,757,773,2333,2357,2377,
%T A062088 2557,2753,2777,3253,3257,3323,3527,3727,5233,5237,5273,5323,5527,
%U A062088 7237,7253,7523,7723,7727,22573,23327,25237,25253,25523,27253,27527,32233,32237,32257
%N A062088 Primes with every digit a prime and the sum of the digits a prime.
%H A062088 Alois P. Heinz, <a href="/A062088/b062088.txt">Table of n, a(n) for n = 1..10000</a> (first 718 terms from Marius A. Burtea)
%e A062088 2357 is a prime, each digit is a prime and the sum of digits = 17 is also a prime, so 2357 is a term.
%t A062088 aQ[p_] := PrimeQ[p] && Module[{d = IntegerDigits[p]}, PrimeQ[Total[d]] && LengthWhile[d, PrimeQ[#] &] == Length[d]]; Select[Range[33000], aQ] (* _Amiram Eldar_, Dec 08 2018 *)
%o A062088 (PARI) isok(p) = isprime(p) && isprime(sumdigits(p)) && (#select(x->(! isprime(x)), digits(p)) == 0); \\ _Michel Marcus_, Dec 08 2018
%o A062088 (MATLAB)
%o A062088 prim=primes(1000000);
%o A062088 m=1;
%o A062088 for u=1:100;
%o A062088     v=prim(u);
%o A062088     nc=dec2base(v,10)-'0';
%o A062088     s=sum(nc);
%o A062088          if and(isprime(nc)==1,isprime(s)==1)
%o A062088              sol(m)=v;
%o A062088              m=m+1;
%o A062088          end
%o A062088 end
%o A062088 sol; % _Marius A. Burtea_, Dec 08 2018
%o A062088 (Python)
%o A062088 from sympy import isprime
%o A062088 from itertools import count, islice, product
%o A062088 def agen():
%o A062088     yield from [2, 3, 5, 7]
%o A062088     for d in count(2):
%o A062088         for left in product("2357", repeat=d-1):
%o A062088             for end in "37":
%o A062088                 ts = "".join(left) + end
%o A062088                 if isprime(sum(map(int, ts))):
%o A062088                     t = int(ts)
%o A062088                     if isprime(t): yield t
%o A062088 print(list(islice(agen(), 46))) # _Michael S. Branicky_, Sep 23 2022
%Y A062088 Intersection of A019546 and A046704.
%K A062088 nonn,base,easy
%O A062088 1,1
%A A062088 _Amarnath Murthy_, Jun 16 2001
%E A062088 Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jun 21 2001