[go: up one dir, main page]

login
A007597
Strobogrammatic primes.
(Formerly M4800)
16
11, 101, 181, 619, 16091, 18181, 19861, 61819, 116911, 119611, 160091, 169691, 191161, 196961, 686989, 688889, 1008001, 1068901, 1160911, 1180811, 1190611, 1191611, 1681891, 1690691, 1880881, 1881881, 1898681, 1908061, 1960961, 1990661, 6081809, 6100019, 6108019
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.
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
Cf. A000787.
Sequence in context: A089716 A084987 A083185 * A061247 A199328 A370447
KEYWORD
base,nonn
EXTENSIONS
More terms from David W. Wilson
a(31)-a(33) from K. D. Bajpai, Jun 23 2017
STATUS
approved