OFFSET
1,2
COMMENTS
This is a problem proposed by the French site Diophante in the links section.
The corresponding quotients are in A352085.
The smallest term k such that the corresponding quotient = n is A352086(n).
Some subsequences:
-> wt(m^2) = wt(m) iff m is in A077436.
-> wt(m^2) / wt(m) = 2 iff m is in A083567.
-> When m is a power of 2 (A000079): wt(2^k) = wt((2^k)^2) = wt(2^(2k)) = 1.
LINKS
Martin Ehrenstein, Table of n, a(n) for n = 1..10000
Diophante, A1730 - Des chiffres à sommer pour un entier (in French).
EXAMPLE
37_10 = 100101_2, digsum_2(37) = 1+1+1 = 3; then 37^2 = 1369_10 = 10101011001_2, digsum_2(1369) = 1+1+1+1+1+1 = 6; as 3 divides 6, 37 is a term.
MATHEMATICA
Select[Range[180], Divisible[Total[IntegerDigits[#^2, 2]], Total[IntegerDigits[#, 2]]] &] (* Amiram Eldar, Mar 03 2022 *)
PROG
(Python)
def ok(n): return n > 0 and bin(n**2).count('1')%bin(n).count('1') == 0
print([m for m in range(1, 200) if ok(m)]) # Michael S. Branicky, Mar 03 2022
(PARI) isok(m) = !(hammingweight(m^2) % hammingweight(m)); \\ Michel Marcus, Mar 03 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Mar 03 2022
EXTENSIONS
More terms from Amiram Eldar, Mar 03 2022
STATUS
approved