login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007597 Strobogrammatic primes.
(Formerly M4800)
15

%I M4800 #32 Apr 03 2023 10:36:09

%S 11,101,181,619,16091,18181,19861,61819,116911,119611,160091,169691,

%T 191161,196961,686989,688889,1008001,1068901,1160911,1180811,1190611,

%U 1191611,1681891,1690691,1880881,1881881,1898681,1908061,1960961,1990661,6081809,6100019,6108019

%N Strobogrammatic primes.

%C Primes which are invariant under a 180-degree rotation.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%D C. W. Trigg, "Strobogrammatic Primes and Prime Rotative Twins", J. Rec. Math., 15 (1983), 281-282.

%H Michael S. Branicky, <a href="/A007597/b007597.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..304 from K. D. Bajpai)

%H C. K. Caldwell, The Prime Glossary, <a href="https://t5k.org/glossary/page.php/strobogrammatic.html">Strobogrammatic</a>

%H Ernest G. Hibbs, <a href="https://www.proquest.com/openview/4012f0286b785cd732c78eb0fc6fce80">Component Interactions of the Prime Numbers</a>, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Strobogrammatic_prime">Strobogrammatic prime</a>

%t 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 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice, product

%o def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})

%o def agen():

%o for d in count(2):

%o for start in "1689":

%o for rest in product("01689", repeat=d//2-1):

%o left = start + "".join(rest)

%o right = ud(left)

%o for mid in [[""], ["0", "1", "8"]][d%2]:

%o t = int(left + mid + right)

%o if isprime(t):

%o yield t

%o print(list(islice(agen(), 33))) # _Michael S. Branicky_, Mar 29 2022

%Y Cf. A000787.

%K base,nonn

%O 1,1

%A _N. J. A. Sloane_, _Robert G. Wilson v_

%E More terms from _David W. Wilson_

%E a(31)-a(33) from _K. D. Bajpai_, Jun 23 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 17:08 EDT 2024. Contains 371749 sequences. (Running on oeis4.)