OFFSET
1,1
COMMENTS
Primes which are invariant under a 180-degree rotation.
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
C. W. Trigg, "Strobogrammatic Primes and Prime Rotative Twins", J. Rec. Math., 15 (1983), 281-282.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..304 from K. D. Bajpai)
C. K. Caldwell, The Prime Glossary, Strobogrammatic
Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
Wikipedia, Strobogrammatic prime
MATHEMATICA
lst = {}; fQ[n_] := Block[{allset = {0, 1, 6, 8, 9}, id = IntegerDigits@n}, Union@ Join[id, allset] == allset && Reverse[id /. {6 -> 9, 9 -> 6}] == id]; Do[ If[ PrimeQ@n && fQ@n, AppendTo[lst, n]], {n, 2000000}]; lst (* Robert G. Wilson v, Feb 27 2007 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
def agen():
for d in count(2):
for start in "1689":
for rest in product("01689", repeat=d//2-1):
left = start + "".join(rest)
right = ud(left)
for mid in [[""], ["0", "1", "8"]][d%2]:
t = int(left + mid + right)
if isprime(t):
yield t
print(list(islice(agen(), 33))) # Michael S. Branicky, Mar 29 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
EXTENSIONS
More terms from David W. Wilson
a(31)-a(33) from K. D. Bajpai, Jun 23 2017
STATUS
approved