OFFSET
1,1
COMMENTS
The squares must have an even number of binary digits, given by ceiling(log_2(a(n)^2)) = ceiling(2 log_2 a(n)), or equivalently, 2^(k-1/2) < a(n) < 2^k for some integer k > 0, which explains the jumps in the graph of the sequence. - M. F. Hasler, Jul 12 2022
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
James Propp et al., Perfectly balanced perfect squaresmath-fun mailing list (archive available to subscribers), Jul 12 2022.
FORMULA
{n | n^2 is in A031443} = {n | 2*A000120(n^2) = A070939(n^2)}, i.e., twice the Hamming weight must equal the number of binary digits, for the squares of the terms. - M. F. Hasler, Jul 12 2022
MATHEMATICA
sn01Q[n_]:=Module[{idn2=IntegerDigits[n^2, 2]}, Count[idn2, 1] == Length[ idn2]/2]; Select[Range[600], sn01Q] (* Harvey P. Dale, Apr 03 2016 *)
PROG
(PARI) select( {is_A164344(n)=hammingweight(n^2)*2==exponent(n^2*2)}, [0..512]) \\ M. F. Hasler, Jul 12 2022
(Python)
def bal(n): return n and n.bit_length() == n.bit_count() * 2
print([k for k in range(512) if bal(k*k)]) # Michael S. Branicky, Jul 12 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Aug 13 2009
EXTENSIONS
More terms from Sean A. Irvine, Oct 08 2009
STATUS
approved