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.

A167631 Emirps A006567 with a sum of digits and a number of digits which are both primes.

This page as a plain text file.
%I A167631 #13 Feb 19 2025 16:12:00
%S A167631 113,157,179,199,311,337,359,733,739,751,937,953,971,991,10039,10079,
%T A167631 10091,10253,10273,10321,10343,10453,10457,10459,10499,10613,10639,
%U A167631 10651,10781,10853,10859,10891,10909,11003,11083,11159,11197,11243
%N A167631 Emirps A006567 with a sum of digits and a number of digits which are both primes.
%C A167631 Subsequence of A006567 and A028834. - _R. J. Mathar_, Nov 12 2009
%H A167631 Karl-Heinz Hofmann, <a href="/A167631/b167631.txt">Table of n, a(n) for n = 1..10000</a>
%e A167631 113 and 311 are distinct primes, and 3 (number of digits) and 5 (1+1+3) are also primes.
%o A167631 (PARI) sod(n)=my(s=0);while(n>9,s+=n%10;n\=10);s+n
%o A167631 R(n)=my(v=eval(Vec(Str(n))),s=0);forstep(i=#v,1,-1,s=10*s+v[i]);s
%o A167631 isA167631(n)=my(r); isprime(#Str(n)) && isprime(sod(n)) && isprime(n) && isprime(r=R(n)) && n!=r \\ _Charles R Greathouse IV_, Nov 10 2009
%o A167631 (Python)
%o A167631 from sympy import primerange, isprime
%o A167631 A167631 =[]
%o A167631 for power_of_ten in [2,3,5]: # (7 can be added (12 sec. and 26790 terms), 11 not recommended)
%o A167631     primes = list(primerange(10**(power_of_ten-1),10**power_of_ten))
%o A167631     for p in primes:
%o A167631         if str(p) != (p_rev:=str(p)[::-1]):
%o A167631             if isprime(int(p_rev)):
%o A167631                 if isprime(sum(list(map(int, p_rev.strip())))): A167631.append(p)
%o A167631 print(A167631) # _Karl-Heinz Hofmann_, Feb 19 2025
%K A167631 base,nonn
%O A167631 1,1
%A A167631 _Claudio Meller_, Nov 07 2009
%E A167631 Edited by _Charles R Greathouse IV_ and _R. J. Mathar_, Nov 10 2009