login
Lesser of twin primes p,p+2 such that the absolute difference of p and the reverse of p+2 is a twin prime and the absolute difference of p+2 and the reverse of p is a twin prime.
1

%I #13 Mar 08 2021 16:40:36

%S 41,281,827,857,2081,2801,8087,20981,21191,21491,81197,88607,206411,

%T 225941,227531,233141,249131,255971,261971,279551,283571,825107,

%U 827537,828407,834857,857567,861977,864047,869777,879167,883577,895787,2051111,2125601,2128601,2130701,2141801,2147021,2163221

%N Lesser of twin primes p,p+2 such that the absolute difference of p and the reverse of p+2 is a twin prime and the absolute difference of p+2 and the reverse of p is a twin prime.

%C Lesser of twin primes p such that both p and p+2 are in A342216.

%C Except for the first term, all terms either start with 2 and end with 1 or start with 8 and end with 7.

%H Robert Israel, <a href="/A342299/b342299.txt">Table of n, a(n) for n = 1..4327</a>

%e a(3) = 827 is a term because 827 and 829 are twin primes, and |827-928| = 101 and |827-728| = 101, and 101 is a twin prime.

%e a(5) = 2081 is a term because 2081 and 2083 are twin primes, and |2081-3802| = 1721 and |2083-1802| = 281 are twin primes.

%p digrev:= proc(n) local L,i;

%p L:= convert(n,base,10);

%p add(10^(i-1)*L[-i],i=1..nops(L))

%p end proc:

%p filter:= proc(p) local q,t,s;

%p if not isprime(p) then return false fi;

%p q:= p+2;

%p if not isprime(q) then return false fi;

%p t:= abs(p - digrev(q));

%p s:= abs(q - digrev(p));

%p isprime(t) and isprime(s) and (isprime(t-2) or isprime(t+2)) and (isprime(s-2) or isprime(s+2))

%p end proc:

%p select(filter, [seq(i,i=5..10^7,6)]);

%Y Cf. A004086, A001097, A001359, A342216.

%K nonn,base

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Mar 07 2021