A164343 A positive integer is included if it is a square that contains the same number of 0's as 1's when represented in binary.
9, 49, 169, 225, 625, 841, 961, 2916, 3249, 3721, 3969, 10609, 12100, 12769, 13924, 14641, 15625, 16129, 39601, 41209, 42849, 44944, 45369, 45796, 47524, 52900, 56644, 58081, 60516, 62001, 64009, 65025, 151321, 154449, 155236, 156025, 161604, 163216, 167281
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
Programs
-
Mathematica
Select[Range[500]^2,DigitCount[#,2,1]==DigitCount[#,2,0]&] (* Harvey P. Dale, Nov 18 2014 *)
-
Python
def bal(n): return n and n.bit_length() == n.bit_count() * 2 print([s for s in (k*k for k in range(403)) if bal(s)]) # Michael S. Branicky, Jul 12 2022
Extensions
More terms from Sean A. Irvine, Oct 08 2009