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.

A345409 Numbers that are the sum of an emirp and its reversal.

This page as a plain text file.
%I A345409 #9 Jun 18 2021 19:50:42
%S A345409 44,88,110,176,424,808,908,928,1070,1090,1150,1190,1312,1372,1616,
%T A345409 1676,1736,2222,2332,2552,2662,2992,3212,4114,4334,4444,4664,4774,
%U A345409 4994,5104,5324,5434,6226,6776,6886,7106,7436,8338,8558,8998,9218,9328,9548,10010,10120,10450,10670,10780,11000,11110
%N A345409 Numbers that are the sum of an emirp and its reversal.
%H A345409 Robert Israel, <a href="/A345409/b345409.txt">Table of n, a(n) for n = 1..10000</a>
%e A345409 a(3) = 110 is a member because 110 = 37+73 where 37 is an emirp.
%p A345409 revdigs:= proc(n) local L,i; L:= convert(n,base,10); add(L[-i]*10^(i-1),i=1..nops(L)) end proc:
%p A345409 f:= proc(n) local r;
%p A345409 if not isprime(n) then return NULL fi;
%p A345409 r:= revdigs(n);
%p A345409 if r > n and isprime(r) then return r+n fi
%p A345409 end proc:
%p A345409 S:= map(f, {seq(seq(seq(i*10^d+j,j=1..10^d-1,2),i=[1,3,7,9]),d=1..4)}):
%p A345409 sort(convert(S,list));
%o A345409 (Python)
%o A345409 from sympy import isprime, nextprime
%o A345409 def epgen(start=1, end=float('inf')): # generates unique emirp/prime pairs
%o A345409     p = nextprime(start-1)
%o A345409     while p <= end:
%o A345409         revp = int(str(p)[::-1])
%o A345409         if p < revp and isprime(revp): yield (p, revp)
%o A345409         p = nextprime(p)
%o A345409 def aupto(lim):
%o A345409     epsums = set(sum(ep) for ep in epgen(1, lim))
%o A345409     return sorted(filter(lambda x: x<=lim, epsums))
%o A345409 print(aupto(11111)) # _Michael S. Branicky_, Jun 18 2021
%Y A345409 Cf. A006567, A345408.
%K A345409 nonn
%O A345409 1,1
%A A345409 _J. M. Bergot_ and _Robert Israel_, Jun 18 2021