cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A178316 Primes whose digital rotation is still prime.

This page as a plain text file.
%I A178316 #16 Apr 19 2024 23:40:39
%S A178316 2,5,11,19,61,101,109,151,181,199,601,619,659,661,1019,1021,1061,1091,
%T A178316 1109,1129,1151,1181,1201,1229,1259,1291,1511,1559,1601,1609,1621,
%U A178316 1669,1699,1811,1901,1999,6011,6091,6101,6199,6211,6221,6229,6521,6551,6569
%N A178316 Primes whose digital rotation is still prime.
%C A178316 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).
%D A178316 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.
%H A178316 Seiichi Manyama, <a href="/A178316/b178316.txt">Table of n, a(n) for n = 1..10000</a>
%e A178316 For example 1259 becomes 6521 under such a rotation.
%t A178316 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 *)
%o A178316 (Python)
%o A178316 from itertools import count, islice, product
%o A178316 from sympy import isprime
%o A178316 def A178316_gen():
%o A178316     yield from (2,5)
%o A178316     r = ''.maketrans('69','96')
%o A178316     for l in count(1):
%o A178316         for a in '125689':
%o A178316             for d in product('0125689',repeat=l):
%o A178316                 s = a+''.join(d)
%o A178316                 m = int(s)
%o A178316                 if isprime(m) and isprime(int(s[::-1].translate(r))):
%o A178316                     yield m
%o A178316 A178316_list = list(islice(A178316_gen(),40)) # _Chai Wah Wu_, Apr 09 2024
%Y A178316 Cf. A007500, A055387, A018847.
%K A178316 nonn,base
%O A178316 1,1
%A A178316 _David Nacin_, May 24 2010