login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers k sandwiched between twin primes, such that k times the reverse of k is also sandwiched between twin primes.
0

%I #10 Sep 26 2022 20:34:37

%S 198,642,1050,2730,3000,4050,4230,4272,4548,4638,4968,5010,6270,7950,

%T 8970,9630,9858,10092,11700,12240,17490,18918,22740,25470,33750,37200,

%U 39240,45180,48648,48732,48822,49548,52182,53172,55620,56532,57330,58602,60918,65100,65730,70140

%N Numbers k sandwiched between twin primes, such that k times the reverse of k is also sandwiched between twin primes.

%C Subsequence of A014574.

%e 198 is sandwiched between two twin primes 197 and 199. 176418 = 198*891 is also sandwiched between two twin primes. Thus, 198 is in this sequence.

%t Select[Range[100000],PrimeQ[# - 1] && PrimeQ[# + 1] && PrimeQ[# FromDigits[Reverse[IntegerDigits[#]]] - 1] && PrimeQ[# FromDigits[Reverse[IntegerDigits[#]]] + 1] &]

%o (Python)

%o from sympy import isprime

%o def sw(n): return isprime(n-1) and isprime(n+1)

%o def ok(n): return n%2 == 0 and sw(n) and sw(n*int(str(n)[::-1]))

%o print([k for k in range(10**5) if ok(k)]) # _Michael S. Branicky_, Sep 10 2022

%Y Cf. A014574.

%K nonn,base

%O 1,1

%A _Tanya Khovanova_, Sep 10 2022