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 A309776 #53 Nov 11 2019 14:02:00 %S A309776 0,1,1,2,1,2,3,4,1,2,4,5,4,5,7,8,1,2,5,6,7,8,11,12,5,6,9,10,11,12,15, %T A309776 16,1,2,6,7,11,12,16,17,11,12,16,17,21,22,26,27,6,7,11,12,16,17,21,22, %U A309776 16,17,21,22,26,27,31,32,1,2,7,8,16,17,22,23,21,22 %N A309776 Form a triangle: first row is n in base 2, next row is sums of pairs of adjacent digits of previous row, repeat until get a single number which is a(n). %C A309776 a(n) = 1 occurs at n = 2^k for nonnegative integers k. %H A309776 Rémy Sigrist, <a href="/A309776/b309776.txt">Table of n, a(n) for n = 0..16384</a> %F A309776 From _Bernard Schott_, Sep 22 2019: (Start) %F A309776 a(2^k + 1) = 2 for k >= 1 where 2^k+1 = 1000..0001_2. %F A309776 a(2^k - 1) = 2^(k-1) for k >= 2 where 2^k-1 = 111..111_2. %F A309776 a((4^k-1)/3) = 2^(2*k-3) for k >= 2 where (4^k-1)/3 = 10101..0101_2. %F A309776 (End) %e A309776 For n=5 the triangle is %e A309776 1 0 1 %e A309776 1 1 %e A309776 2 %e A309776 so a(5)=2. %e A309776 For n=14 we get %e A309776 1 1 1 0 %e A309776 2 2 1 %e A309776 4 3 %e A309776 7 %e A309776 so a(14)=7. %e A309776 For n=26=11010_2; (n1+n2, n2+n3, n3+n4, n4+n5) = 2111; (n1'+n2', n2'+n3', n3'+n4') = 322; (n1''+n2'', n2''+n3'') = 54; (n1'''+n2''') = 9; a(26)= 9. %o A309776 (PARI) a(n) = my (b=binary(n)); sum(k=1, #b, b[k]*binomial(#b-1,k-1)) \\ _Rémy Sigrist_, Aug 20 2019 %Y A309776 Cf. A306607. %K A309776 nonn,base %O A309776 0,4 %A A309776 _Cameron Musard_, Aug 16 2019 %E A309776 Edited by _N. J. A. Sloane_, Sep 21 2019 %E A309776 Data corrected by _Rémy Sigrist_, Sep 22 2019