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.
%I A340842 #11 Jan 25 2021 19:02:58 %S A340842 13,71,97,701,1061,1223,1597,1847,1933,3067,3089,3373,3391,3889,7027, %T A340842 7043,7577,9001,9241,9421,10061,10151,10333,10867,11057,11657,11677, %U A340842 11897,11923,12227,12269,12809,13147,13457,13477,14087,14207,16979,17011,17033,17903,32173,32203,32353,32687,33589 %N A340842 Emirps p such that p + (sum of digits of p) is an emirp. %H A340842 Robert Israel, <a href="/A340842/b340842.txt">Table of n, a(n) for n = 1..10000</a> %e A340842 a(3) = 97 is an emirp because 97 and 79 are distinct primes. Its sum of digits is 9+7=16, and 97+16 = 113 is an emirp because 113 and 311 are primes. %p A340842 revdigs:= proc(n) local L,i; %p A340842 L:= convert(n,base,10); %p A340842 add(10^(i-1)*L[-i],i=1..nops(L)) %p A340842 end proc: %p A340842 isemirp:= proc(n) local r; %p A340842 if not isprime(n) then return false fi; %p A340842 r:= revdigs(n); %p A340842 r <> n and isprime(r) %p A340842 end proc: %p A340842 filter:= n -> isemirp(n) and isemirp(n +convert(convert(n,base,10),`+`)): %p A340842 select(filter, [seq(i,i=3..10^5,2)]); %o A340842 (Python) %o A340842 from sympy import isprime %o A340842 def sd(n): return sum(map(int, str(n))) %o A340842 def emirp(n): %o A340842 if not isprime(n): return False %o A340842 revn = int(str(n)[::-1]) %o A340842 if n == revn: return False %o A340842 return isprime(revn) %o A340842 def ok(n): return emirp(n) and emirp(n + sd(n)) %o A340842 def aupto(nn): return [m for m in range(1, nn+1) if ok(m)] %o A340842 print(aupto(18000)) # _Michael S. Branicky_, Jan 24 2021 %Y A340842 Cf. A006567. Contains A340843. %K A340842 nonn,base %O A340842 1,1 %A A340842 _J. M. Bergot_ and _Robert Israel_, Jan 23 2021