Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 Apr 19 2024 23:40:39
%S 2,5,11,19,61,101,109,151,181,199,601,619,659,661,1019,1021,1061,1091,
%T 1109,1129,1151,1181,1201,1229,1259,1291,1511,1559,1601,1609,1621,
%U 1669,1699,1811,1901,1999,6011,6091,6101,6199,6211,6221,6229,6521,6551,6569
%N Primes whose digital rotation is still prime.
%C This means if written as in a digital clock and rotated 180 degrees around the center the result is also prime (possibly a different prime).
%D Guy, R. K., Unsolved Problems in Number Theory, p 15 This sequence is related to the palindromic primes with symmetries as in Guy's book.
%H Seiichi Manyama, <a href="/A178316/b178316.txt">Table of n, a(n) for n = 1..10000</a>
%e For example 1259 becomes 6521 under such a rotation.
%t Select[Range[6570],PrimeQ[#]&&PrimeQ[FromDigits[Reverse[IntegerDigits[#]/.{6->9,9->6}]]]&&ContainsOnly[IntegerDigits[#],{0,1,2,5,6,8,9}]&] (* _James C. McMahon_, Apr 09 2024 *)
%o (Python)
%o from itertools import count, islice, product
%o from sympy import isprime
%o def A178316_gen():
%o yield from (2,5)
%o r = ''.maketrans('69','96')
%o for l in count(1):
%o for a in '125689':
%o for d in product('0125689',repeat=l):
%o s = a+''.join(d)
%o m = int(s)
%o if isprime(m) and isprime(int(s[::-1].translate(r))):
%o yield m
%o A178316_list = list(islice(A178316_gen(),40)) # _Chai Wah Wu_, Apr 09 2024
%Y Cf. A007500, A055387, A018847.
%K nonn,base
%O 1,1
%A _David Nacin_, May 24 2010