login
A389481
Primes that remain prime when their binary digits are rotated once to the right.
2
3, 7, 11, 31, 43, 59, 67, 79, 127, 131, 139, 167, 191, 199, 211, 223, 227, 283, 307, 331, 367, 463, 487, 523, 571, 599, 619, 631, 683, 691, 739, 743, 751, 859, 883, 911, 919, 971, 1019, 1039, 1051, 1087, 1171, 1279, 1291, 1399, 1447, 1459, 1471, 1531, 1699, 1951, 1987
OFFSET
1,1
LINKS
EXAMPLE
Prime 7 = 111_2 is a term since rotating its binary digits once to the right yields 111_2 = 7 again, prime.
Prime 43 = 101011_2 is a term since rotating its binary digits once to the right yields 110101_2 = 53, prime.
Prime 5 = 101_2 is not a term since rotating its binary digits once to the right yields 110_2 = 6, not prime.
MAPLE
filter:= proc(n) isprime(n) and isprime(floor(n/2) + 2^ilog2(n)) end proc:
select(filter, [seq(i, i=3..2000, 4)]); # Robert Israel, Oct 06 2025
MATHEMATICA
Select[Prime[Range[300]], PrimeQ[FromDigits[RotateRight[IntegerDigits[#, 2]], 2]]&] (* James C. McMahon, Oct 15 2025 *)
PROG
(Python)
from sympy import isprime
def ok(n): return isprime(n) and isprime(int((b:=bin(n)[2:])[-1]+b[:-1], 2))
print([k for k in range(2000) if ok(k)]) # Michael S. Branicky, Oct 05 2025
(PARI) isok(p)=isprime(p) && bittest(p, 0) && isprime(p\2 + 2^logint(p, 2)) \\ Andrew Howroyd, Oct 05 2025
CROSSREFS
Supersequence of A389139.
Subset of A002145.
Cf. A004676.
Cf. A234901 (same in base 10).
Sequence in context: A213740 A267357 A152084 * A274134 A131588 A361680
KEYWORD
nonn,base
AUTHOR
Rhys Feltman, Oct 05 2025
EXTENSIONS
More terms from Michael S. Branicky, Oct 05 2025
STATUS
approved