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.

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).

Original entry on oeis.org

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, 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, 16, 17, 21, 22, 26, 27, 31, 32, 1, 2, 7, 8, 16, 17, 22, 23, 21, 22
Offset: 0

Views

Author

Cameron Musard, Aug 16 2019

Keywords

Comments

a(n) = 1 occurs at n = 2^k for nonnegative integers k.

Examples

			For n=5 the triangle is
  1 0 1
   1 1
    2
so a(5)=2.
For n=14 we get
  1 1 1 0
   2 2 1
    4 3
     7
so a(14)=7.
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.
		

Crossrefs

Cf. A306607.

Programs

  • PARI
    a(n) = my (b=binary(n)); sum(k=1, #b, b[k]*binomial(#b-1,k-1)) \\ Rémy Sigrist, Aug 20 2019

Formula

From Bernard Schott, Sep 22 2019: (Start)
a(2^k + 1) = 2 for k >= 1 where 2^k+1 = 1000..0001_2.
a(2^k - 1) = 2^(k-1) for k >= 2 where 2^k-1 = 111..111_2.
a((4^k-1)/3) = 2^(2*k-3) for k >= 2 where (4^k-1)/3 = 10101..0101_2.
(End)

Extensions

Edited by N. J. A. Sloane, Sep 21 2019
Data corrected by Rémy Sigrist, Sep 22 2019