login
a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.
3

%I #25 Jul 28 2023 04:09:03

%S 1,1,10,11,101,111,1010,1100,1110,10001,10011,10110,11001,11100,11111,

%T 100100,100110,101001,101100,101111,110100,110111,111100,1000000,

%U 1000001,1000011,1000110,1001001,1001100,1001111,1010100,1010111,1011100,1100000,1100010

%N a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.

%C Equals A230297 = A010062 converted from decimal to binary, prefixed by another initial 1. - _M. F. Hasler_, Nov 18 2019

%H Alois P. Heinz, <a href="/A157845/b157845.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A230297(n-1) = A007088(A010062(n-1)) = A007088(A092391(A028897(a(n-1)))) for n > 0. - _M. F. Hasler_, Nov 18 2019

%p b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+

%p add(i, i=convert(a(n-1), base, 10)))

%p end:

%p a:= n-> convert(b(n), binary):

%p seq(a(n), n=0..44); # _Alois P. Heinz_, Nov 18 2019

%t 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 *)

%o (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););}

%o (PARI) apply( A157845(n)=fromdigits(binary(A010062(n-!!n))), [0..40]) \\ _M. F. Hasler_, Nov 18 2019

%Y Cf. A004207 (base-10 analog); A007088 (n in binary), A010062 (this written in base 10), A000120 (Hammingweight), A092391 (A000120(n) + n), A028897 (convert binary to decimal).

%K base,easy,nonn

%O 0,3

%A _Oliver K. Seet_, Mar 07 2009

%E a(11) corrected and extended by _R. J. Mathar_, Mar 12 2009

%E More terms from _Michel Marcus_, Apr 19 2014