A348906 Squares with a square number of 1's in their binary expansion.
0, 1, 4, 16, 64, 169, 225, 256, 676, 900, 1024, 2209, 2704, 3600, 4096, 5625, 7921, 8836, 10201, 10816, 12321, 13689, 14400, 16384, 19321, 20449, 22201, 22500, 23409, 26569, 27889, 28561, 29929, 30625, 31684, 32041, 35344, 38809, 40401, 40804, 43264, 49284, 52441
Offset: 1
Examples
225 is in the sequence because it is a square and the number of 1's in the binary expansion of 225 is 4 which is a square.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Maple
q:= n-> issqr(add(i, i=Bits[Split](n))): select(q, [i^2$i=0..250])[]; # Alois P. Heinz, Nov 03 2021
-
Mathematica
Select[Range[0, 300]^2, IntegerQ @ Sqrt[DigitCount[#, 2, 1]] &] (* Amiram Eldar, Nov 03 2021 *)
-
PARI
isok(k) = issquare(k) && issquare(hammingweight(k)); \\ Michel Marcus, Nov 03 2021
Comments