OFFSET
1,1
COMMENTS
The sequence of corresponding squares begins: 1, 25, 121, 169, 625, 841, 1369, 2209, 2401, 3025, 3481, 2809, 4225, 7921, ...
For n>1 the second and third most significant bits of a(n) are "0" because all odd squares are equal to 1 mod 8. - Andres Cicuttin, May 12 2016
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..6182
MATHEMATICA
Select[Table[Prime[j], {j, 1, 10000}], Element[Sqrt[FromDigits[Reverse[IntegerDigits[#, 2]], 2]], Integers]&] (* Andres Cicuttin, May 12 2016 *)
PROG
(Python)
import math
primes = []
def addPrime(k):
for p in primes:
if k%p==0: return
if p*p > k: break
primes.append(k)
r = 0
p = k
while k:
r = r*2 + (k&1)
k>>=1
s = int(math.sqrt(r))
if s*s == r: print(p, end=', ')
addPrime(2)
addPrime(3)
for i in range(5, 1000000000, 6):
addPrime(i)
addPrime(i+2)
(Python)
from sympy import isprime
A226019_list, i, j = [2], 0, 0
while j < 2**34:
p = int(format(j, 'b')[::-1], 2)
if j % 2 and isprime(p):
A226019_list.append(p)
j += 2*i+1
i += 1
(Python)
from sympy import integer_nthroot, primerange
def ok(p): return integer_nthroot(int(bin(p)[:1:-1], 2), 2)[1]
def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
print(aupto(80071)) # Michael S. Branicky, Feb 19 2021
(PARI) isok(k) = isprime(k) && issquare(fromdigits(Vecrev(binary(k)), 2)); \\ Michel Marcus, Feb 19 2021
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Alex Ratushnyak, May 23 2013
STATUS
approved