VOOZH about

URL: https://oeis.org/A389139

⇱ A389139 - OEIS


login
A389139
Primes that remain prime when their digits are rotated once to the right in both binary and decimal.
3
3, 7, 11, 31, 79, 131, 199, 571, 631, 911, 919, 971, 1039, 1171, 1279, 1291, 1531, 2011, 2311, 2591, 2819, 2939, 2971, 3119, 3191, 3499, 3719, 3919, 4091, 4231, 5791, 6991, 8011, 8311, 8599, 8839, 9011, 9871, 10099, 10271, 10691, 10799, 10979, 11131, 11279, 11299
OFFSET
1,1
EXAMPLE
Prime 131 = 10000011_2 is a term since 113 and 11000001_2 = 197 are prime.
Prime 5 = 101_2 is not a term because 110_2 = 6 is not prime.
MATHEMATICA
prQ[p_, b_] := PrimeQ[FromDigits[StringRotateRight[IntegerString[p, b]], b]];
Select[Prime[Range[2000]], prQ[#, 2] && prQ[#, 10] &] (* Paolo Xausa, Sep 29 2025 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
s, b = str(n), bin(n)[2:]
return isprime(int(s[-1]+s[:-1])) and isprime(int(b[-1]+b[:-1], 2))
print([k for k in range(11300) if ok(k)]) # Michael S. Branicky, Sep 24 2025
CROSSREFS
Intersection of A234901 and A389481.
Sequence in context: A091938 A333424 A186893 * A051919 A119175 A038913
KEYWORD
nonn,base
AUTHOR
Rhys Feltman, Sep 24 2025
STATUS
approved