OFFSET
1,1
COMMENTS
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
A000040(12)=37 --> '100101' --> '[1]00101' --> '[0]00101' --> '101' --> 5, therefore 37 is a term.
MATHEMATICA
Select[Prime[Range[100]], PrimeQ[# - 2^Floor[Log[2, #]]] &] (* T. D. Noe, Apr 08 2011 *)
Select[Prime[Range[200]], PrimeQ[FromDigits[Rest[ IntegerDigits[ #, 2]], 2]]&] (* Harvey P. Dale, Apr 08 2016 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p): return isprime((1 << (p.bit_length()-1)) ^ p)
def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p)]
print(aupto(1061)) # Michael S. Branicky, Jul 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 14 2004
STATUS
approved