The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A340956 Integers n such that s(n^2) = s(n)*(s(n)+1)/2, where s(n) is the sum of binary digits of n (A000120). 1
 0, 1, 2, 4, 5, 8, 9, 10, 16, 17, 18, 20, 21, 32, 33, 34, 36, 37, 40, 42, 64, 65, 66, 68, 69, 72, 73, 74, 80, 81, 84, 128, 129, 130, 132, 133, 136, 137, 138, 144, 146, 148, 160, 161, 162, 168, 256, 257, 258, 260, 261, 264, 265, 266, 272, 273, 274, 276, 277, 288, 289, 292, 293, 296, 320, 321, 322, 324, 336, 337, 512, 513, 514, 516 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS Also, integers n such that A159918(n) = A000217(A000120(n)). For any n, s(n^2) <= s(n)*(s(n)+1)/2. This sequence gives n for which the equality is achieved. LINKS Alois P. Heinz, Table of n, a(n) for n = 1..10000 MAPLE q:= n-> (s-> is(s(n^2)=(t->t(s(n)))(h->h*(h+1)/2)))(          k-> add(i, i=Bits[Split](k))): select(q, [\$0..555])[];  # Alois P. Heinz, Feb 01 2021 MATHEMATICA s[n_] := DigitCount[n, 2, 1]; t[n_] := n*(n + 1)/2; Select[Range[0, 500], s[#^2] == t[s[#]] &] (* Amiram Eldar, Feb 01 2021 *) PROG (PARI) isok(n) = my(hn=hammingweight(n)); hammingweight(n^2) == hn*(hn+1)/2; \\ Michel Marcus, Feb 01 2021 CROSSREFS Cf. A000120, A000217, A000290, A159918. Sequence in context: A339906 A279430 A003714 * A010402 A010443 A035269 Adjacent sequences:  A340953 A340954 A340955 * A340957 A340958 A340959 KEYWORD nonn,base AUTHOR Max Alekseyev, Feb 01 2021 STATUS approved

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

Last modified November 29 21:32 EST 2021. Contains 349416 sequences. (Running on oeis4.)