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

 

Logo

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!)
A077436 Let B(n) be the sum of binary digits of n. This sequence contains n such that B(n) = B(n^2). 26
0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 79, 91, 96, 112, 120, 124, 126, 127, 128, 157, 158, 159, 182, 183, 187, 192, 224, 240, 248, 252, 254, 255, 256, 279, 287, 314, 316, 317, 318, 319, 351, 364, 365, 366, 374, 375, 379, 384 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Superset of A023758.

A159918(a(n)) = A000120(a(n)). - Reinhard Zumkeller, Apr 25 2009

Hare, Laishram, & Stoll show that this sequence contains infinitely many odd numbers. In particular for each k in {12, 13, 16, 17, 18, 19, 20, ...} there are infinitely many terms in this sequence with binary digit sum k. - Charles R Greathouse IV, Aug 25 2015

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10476, all terms <= 2^20

K. G. Hare, S. Laishram, and T. Stoll, The sum of digits of n and n^2, International Journal of Number Theory 7:7 (2011), pp. 1737-1752.

Giuseppe Melfi, On simultaneous binary expansions of n and n^2, arXiv:math/0402458 [math.NT], 2004.

Giuseppe Melfi, Su alcune successioni di interi (English with an Italian title)

EXAMPLE

The element 79 belongs to the sequence because 79=(1001111) and 79^2=(1100001100001), so B(79)=B(79^2)

MAPLE

select(t -> convert(convert(t, base, 2), `+`) = convert(convert(t^2, base, 2), `+`), [$0..1000]); # Robert Israel, Aug 27 2015

MATHEMATICA

t={}; Do[If[DigitCount[n, 2, 1] == DigitCount[n^2, 2, 1], AppendTo[t, n]], {n, 0, 364}]; t

f[n_] := Total@ IntegerDigits[n, 2]; Select[Range[0, 384], f@ # == f[#^2] &] (* Michael De Vlieger, Aug 27 2015 *)

PROG

(Haskell)

import Data.List (elemIndices)

import Data.Function (on)

a077436 n = a077436_list !! (n-1)

a077436_list = elemIndices 0

   $ zipWith ((-) `on` a000120) [0..] a000290_list

-- Reinhard Zumkeller, Apr 12 2011

(PARI) is(n)=hammingweight(n)==hammingweight(n^2) \\ Charles R Greathouse IV, Aug 25 2015

(MAGMA) [n: n in [0..400] | &+Intseq(n, 2) eq &+Intseq(n^2, 2)]; // Vincenzo Librandi, Aug 30 2015

CROSSREFS

Cf. A058369, A000120, A000290, A083567, A211676 (number of n-bit numbers in this sequence).

A261586 is a subsequence.

Sequence in context: A257250 A258209 A300630 * A277704 A082752 A023758

Adjacent sequences:  A077433 A077434 A077435 * A077437 A077438 A077439

KEYWORD

easy,nonn,base

AUTHOR

Giuseppe Melfi, Nov 30 2002

EXTENSIONS

Initial 0 added by Reinhard Zumkeller, Apr 28 2012, Apr 12 2011

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 5 04:10 EST 2021. Contains 349530 sequences. (Running on oeis4.)