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
Seiichi Manyama, Table of n, a(n) for n = 1..10000
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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David Nacin, May 24 2010
STATUS
approved