login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 5

%I #17 Jul 12 2022 21:15:23

%S 9,49,169,225,625,841,961,2916,3249,3721,3969,10609,12100,12769,13924,

%T 14641,15625,16129,39601,41209,42849,44944,45369,45796,47524,52900,

%U 56644,58081,60516,62001,64009,65025,151321,154449,155236,156025,161604,163216,167281

%N 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.

%H Michael S. Branicky, <a href="/A164343/b164343.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale)

%t Select[Range[500]^2,DigitCount[#,2,1]==DigitCount[#,2,0]&] (* _Harvey P. Dale_, Nov 18 2014 *)

%o (Python)

%o def bal(n): return n and n.bit_length() == n.bit_count() * 2

%o print([s for s in (k*k for k in range(403)) if bal(s)]) # _Michael S. Branicky_, Jul 12 2022

%Y Cf. A031443, A164344.

%K base,nonn

%O 1,1

%A _Leroy Quet_, Aug 13 2009

%E More terms from _Sean A. Irvine_, Oct 08 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 15:46 EDT 2024. Contains 372340 sequences. (Running on oeis4.)