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.

A346756 Lesser emirps (A109308) subtracted from their reversals.

This page as a plain text file.
%I A346756 #52 Dec 28 2023 16:12:07
%S A346756 18,54,36,18,594,198,792,594,594,792,792,396,396,594,594,198,198,198,
%T A346756 7992,180,270,2268,540,8532,810,6804,1908,7902,360,2358,630,2718,1908,
%U A346756 5904,1998,7992,90,6084,8172,8262,8442,2538,450,8532,7632,7812,7902,2088,270
%N A346756 Lesser emirps (A109308) subtracted from their reversals.
%H A346756 Robert Israel, <a href="/A346756/b346756.txt">Table of n, a(n) for n = 1..10000</a>
%H A346756 Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_020.htm">Puzzle 20. Reversible Primes</a>, The Prime Puzzles and Problems Connection.
%F A346756 a(n) = reverse(A109308(n)) - A109308(n).
%e A346756 31 - 13 = 18, 71 - 17 = 54, 73 - 37 = 36 (distance between lesser emirps and their reversals).
%p A346756 rev:= proc(n) local L,i;
%p A346756   L:= convert(n,base,10);
%p A346756   add(L[-i]*10^(i-1),i=1..nops(L));
%p A346756 end proc:
%p A346756 f:= proc(p) local r;
%p A346756   if not isprime(p) then return NULL fi;
%p A346756   r:= rev(p);
%p A346756   if r > p and isprime(r) then r-p else NULL fi
%p A346756 end proc:
%p A346756 map(f, [seq(i,i=11 .. 10^4, 2)]); # _Robert Israel_, Dec 28 2023
%t A346756 f[n_] := IntegerReverse[n] - n; Map[f, Select[Range[1500], f[#] > 0 && PrimeQ[#] && PrimeQ @ IntegerReverse[#] &]] (* _Amiram Eldar_, Sep 08 2021 *)
%o A346756 (PARI) rev(p) = fromdigits(Vecrev(digits(p))); \\ A004086
%o A346756 lista(nn) = {my(list = List()); forprime (p=1, nn, my(q=rev(p)); if ((q>p) && isprime(q), listput(list, q-p));); Vec(list);} \\ _Michel Marcus_, Sep 07 2021
%o A346756 (Python)
%o A346756 from sympy import isprime, nextprime
%o A346756 def aupton(terms):
%o A346756     alst, p = [], 2
%o A346756     while len(alst) < terms:
%o A346756         revp = int(str(p)[::-1])
%o A346756         if p < revp and isprime(revp):
%o A346756             alst.append(revp - p)
%o A346756         p = nextprime(p)
%o A346756     return alst
%o A346756 print(aupton(49)) # _Michael S. Branicky_, Sep 08 2021
%Y A346756 Cf. A004086, A006567, A109308.
%K A346756 nonn,base,look
%O A346756 1,1
%A A346756 _George Bull_, Aug 20 2021
%E A346756 Better name and more terms from _Jon E. Schoenfield_, Aug 20 2021