A157845 a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.
1, 1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Maple
b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+ add(i, i=convert(a(n-1), base, 10))) end: a:= n-> convert(b(n), binary): seq(a(n), n=0..44); # Alois P. Heinz, Nov 18 2019
-
Mathematica
s[0] = s[1] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
-
PARI
lista(nn) = {my(s = 1); my(t = 1); print1(t, ", "); for (i=1, nn, sb = binary(s); t = subst(Pol(sb), x, 10); print1(t, ", "); s += hammingweight(sb););}
-
PARI
apply( A157845(n)=fromdigits(binary(A010062(n-!!n))), [0..40]) \\ M. F. Hasler, Nov 18 2019
Formula
Extensions
a(11) corrected and extended by R. J. Mathar, Mar 12 2009
More terms from Michel Marcus, Apr 19 2014
Comments