cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A157845 #25 Jul 28 2023 04:09:03
%S A157845 1,1,10,11,101,111,1010,1100,1110,10001,10011,10110,11001,11100,11111,
%T A157845 100100,100110,101001,101100,101111,110100,110111,111100,1000000,
%U A157845 1000001,1000011,1000110,1001001,1001100,1001111,1010100,1010111,1011100,1100000,1100010
%N A157845 a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.
%C A157845 Equals A230297 = A010062 converted from decimal to binary, prefixed by another initial 1. - _M. F. Hasler_, Nov 18 2019
%H A157845 Alois P. Heinz, <a href="/A157845/b157845.txt">Table of n, a(n) for n = 0..10000</a>
%F A157845 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 A157845 b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+
%p A157845       add(i, i=convert(a(n-1), base, 10)))
%p A157845     end:
%p A157845 a:= n-> convert(b(n), binary):
%p A157845 seq(a(n), n=0..44);  # _Alois P. Heinz_, Nov 18 2019
%t A157845 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 A157845 (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 A157845 (PARI) apply( A157845(n)=fromdigits(binary(A010062(n-!!n))), [0..40]) \\ _M. F. Hasler_, Nov 18 2019
%Y A157845 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 A157845 base,easy,nonn
%O A157845 0,3
%A A157845 _Oliver K. Seet_, Mar 07 2009
%E A157845 a(11) corrected and extended by _R. J. Mathar_, Mar 12 2009
%E A157845 More terms from _Michel Marcus_, Apr 19 2014