login
A178316
Primes whose digital rotation is still prime.
3
2, 5, 11, 19, 61, 101, 109, 151, 181, 199, 601, 619, 659, 661, 1019, 1021, 1061, 1091, 1109, 1129, 1151, 1181, 1201, 1229, 1259, 1291, 1511, 1559, 1601, 1609, 1621, 1669, 1699, 1811, 1901, 1999, 6011, 6091, 6101, 6199, 6211, 6221, 6229, 6521, 6551, 6569
OFFSET
1,1
COMMENTS
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).
REFERENCES
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.
LINKS
EXAMPLE
For example 1259 becomes 6521 under such a rotation.
MATHEMATICA
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 *)
PROG
(Python)
from itertools import count, islice, product
from sympy import isprime
def A178316_gen():
yield from (2, 5)
r = ''.maketrans('69', '96')
for l in count(1):
for a in '125689':
for d in product('0125689', repeat=l):
s = a+''.join(d)
m = int(s)
if isprime(m) and isprime(int(s[::-1].translate(r))):
yield m
A178316_list = list(islice(A178316_gen(), 40)) # Chai Wah Wu, Apr 09 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David Nacin, May 24 2010
STATUS
approved