OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,base
AUTHOR
Rhys Feltman, Oct 05 2025
EXTENSIONS
More terms from Michael S. Branicky, Oct 05 2025
STATUS
approved
