This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A010062 #109 Dec 14 2024 03:58:21 %S A010062 1,2,3,5,7,10,12,14,17,19,22,25,28,31,36,38,41,44,47,52,55,60,64,65, %T A010062 67,70,73,76,79,84,87,92,96,98,101,105,109,114,118,123,129,131,134, %U A010062 137,140,143,148,151,156,160,162,165,169,173,178,182,187,193,196,199,204 %N A010062 a(0)=1; thereafter a(n+1) = a(n) + number of 1's in binary representation of a(n). %C A010062 Sequence A230297 (and A157845 without initial term) converted from binary to decimal, cf. formula. - _M. F. Hasler_, Nov 18 2019 %H A010062 Reinhard Zumkeller, <a href="/A010062/b010062.txt">Table of n, a(n) for n = 0..10000</a> %H A010062 Raoul Nakhmanson-Kulish, <a href="/A010062/a010062.png">Graph of a(n)/(n*log_2(n)/2)</a>, showing self-similar fractal structure. %H A010062 Raoul Nakhmanson-Kulish, <a href="/A010062/a010062_1.png">Graph of f(n)</a>, where f(n) = (a(n)-n*log_2(n)/2)/(n*sqrt(log_2(n)*log_2 log_2(n))) (see Stolarsky's estimate below). %H A010062 Kenneth B. Stolarsky, <a href="http://dx.doi.org/10.1090/S0002-9939-1976-0409340-X">The sum of a digitaddition series</a>, Proc. Amer. Math. Soc. 59 (1976), no. 1, 1--5. MR0409340 (53 #13099) %H A010062 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a> %F A010062 a(n) = (n/2)*log n + O(n*sqrt(log n * loglog n)), where log means log_2. In particular, a(n) ~ (n/2)*log n. [Stolarsky] %F A010062 a(n + 1) = A092391(a(n)) = a(n) + A000120(a(n)). - _Reinhard Zumkeller_, May 27 2012, May 08 2004; corrected thanks to a notice by Lambert Herrgesell %F A010062 a(n) = A028897(A230297(n)) = A028897(A157845(n+1)). - _M. F. Hasler_, Nov 18 2019 %e A010062 a(7) = 14 because a(6) = 12, which is 1100 in binary (having 2 on bits), and 12 + 2 = 14. %e A010062 a(8) = 17 because a(7) = 14, which is 1110 in binary (having 3 on bits), and 14 + 3 = 17. %t A010062 NestList[# + DigitCount[#, 2, 1] &, 1, 60] (* _Alonso del Arte_, Oct 26 2012 *) %o A010062 (PARI) print1(s=1);for(n=2,30,print1(", ", s+=hammingweight(s))) \\ _Charles R Greathouse IV_, Oct 27 2012 %o A010062 (PARI) A010062=List(1); A010062(n)={for(n=#A010062,n, listput(A010062, A092391(A010062[n])));A010062[n+1]} \\ A092391(n)=n+hammingweight(n) \\ _M. F. Hasler_, Nov 18 2019 %o A010062 (Haskell) %o A010062 a010062 n = a010062_list !! n %o A010062 a010062_list = iterate a092391 1 -- _Reinhard Zumkeller_, May 13 2012 %o A010062 (Magma) [n le 1 select 1 else Self(n-1)+&+Intseq(Self(n-1),2): n in [1..61]]; // _Bruno Berselli_, Oct 27 2012 %o A010062 (Python) %o A010062 from itertools import islice %o A010062 def agen(): %o A010062 an = 1 %o A010062 while True: yield an; an += an.bit_count() %o A010062 print(list(islice(agen(), 61))) # _Michael S. Branicky_, Jul 31 2022 %Y A010062 First row of A228083. %Y A010062 For the base-10 analog see A004207. %Y A010062 Cf. A000120, A010061, A092391, A229167, A096303, A229743, A229744, A230297 (this sequence written in binary), A230298 (read mod 2). %Y A010062 See A230088 for partial sums. %Y A010062 Equals A028897 o A230297 = A028897 o A157845 (up to offset); see also A007088. %K A010062 nonn,base,easy,nice %O A010062 0,2 %A A010062 _Leonid Broukhis_, Mar 15 1996 %E A010062 More terms from _Benoit Cloitre_, Jun 02 2002 %E A010062 Stolarsky reference from _Matthew C. Russell_, Oct 08 2013