This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A226019 #35 Nov 11 2024 20:30:23 %S A226019 2,19,79,149,569,587,1237,2129,2153,2237,2459,2549,4129,4591,4657, %T A226019 4999,8369,8999,9587,9629,9857,10061,17401,17659,17737,18691,20149, %U A226019 20479,33161,33347,34631,35117,35447,39023,40427,40709,66403,68539,74707,75703,79063,79333,80071 %N A226019 Primes whose binary reversal is a square. %C A226019 The sequence of corresponding squares begins: 1, 25, 121, 169, 625, 841, 1369, 2209, 2401, 3025, 3481, 2809, 4225, 7921, ... %C A226019 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 %H A226019 Chai Wah Wu, <a href="/A226019/b226019.txt">Table of n, a(n) for n = 1..6182</a> %t A226019 Select[Table[Prime[j],{j,1,10000}],Element[Sqrt[FromDigits[Reverse[IntegerDigits[#,2]],2]],Integers]&] (* _Andres Cicuttin_, May 12 2016 *) %o A226019 (Python) %o A226019 import math %o A226019 primes = [] %o A226019 def addPrime(k): %o A226019 for p in primes: %o A226019 if k%p==0: return %o A226019 if p*p > k: break %o A226019 primes.append(k) %o A226019 r = 0 %o A226019 p = k %o A226019 while k: %o A226019 r = r*2 + (k&1) %o A226019 k>>=1 %o A226019 s = int(math.sqrt(r)) %o A226019 if s*s == r: print(p, end=', ') %o A226019 addPrime(2) %o A226019 addPrime(3) %o A226019 for i in range(5, 1000000000, 6): %o A226019 addPrime(i) %o A226019 addPrime(i+2) %o A226019 (Python) %o A226019 from sympy import isprime %o A226019 A226019_list, i, j = [2], 0, 0 %o A226019 while j < 2**34: %o A226019 p = int(format(j,'b')[::-1],2) %o A226019 if j % 2 and isprime(p): %o A226019 A226019_list.append(p) %o A226019 j += 2*i+1 %o A226019 i += 1 %o A226019 A226019_list = sorted(A226019_list) # _Chai Wah Wu_, Dec 20 2015 %o A226019 (Python) %o A226019 from sympy import integer_nthroot, primerange %o A226019 def ok(p): return integer_nthroot(int(bin(p)[:1:-1], 2), 2)[1] %o A226019 def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)] %o A226019 print(aupto(80071)) # _Michael S. Branicky_, Feb 19 2021 %o A226019 (PARI) isok(k) = isprime(k) && issquare(fromdigits(Vecrev(binary(k)), 2)); \\ _Michel Marcus_, Feb 19 2021 %Y A226019 Cf. A007488, A074832. %Y A226019 Subsequence of A204219. Cf. also A235027. %K A226019 nonn,base %O A226019 1,1 %A A226019 _Alex Ratushnyak_, May 23 2013