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.

A295508 Triangle read by rows, related to binary partitions of n.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 2, 1, 4, 3, 2, 0, 5, 4, 3, 1, 6, 5, 4, 2, 7, 6, 5, 3, 8, 7, 6, 4, 0, 9, 8, 7, 5, 1, 10, 9, 8, 6, 2, 11, 10, 9, 7, 3, 12, 11, 10, 8, 4, 13, 12, 11, 9, 5, 14, 13, 12, 10, 6, 15, 14, 13, 11, 7, 16, 15, 14, 12, 8, 0, 17, 16, 15, 13, 9, 1
Offset: 0

Views

Author

Peter Luschny, Nov 30 2017

Keywords

Examples

			0;
1,   0;
2,   1,  0;
3,   2,  1;
4,   3,  2,  0;
5,   4,  3,  1;
6,   5,  4,  2;
7,   6,  5,  3;
8,   7,  6,  4, 0;
9,   8,  7,  5, 1;
10,  9,  8,  6, 2;
11, 10,  9,  7, 3;
12, 11, 10,  8, 4;
13, 12, 11,  9, 5;
14, 13, 12, 10, 6;
15, 14, 13, 11, 7;
		

Crossrefs

Cf. A123753.

Programs

  • Maple
    A295508_row := proc(n) local i, s, z; s := n; i := n-1; z := 1;
    while 0 <= i do s := s,i; i := i-z; z := z+z od; s end:
    seq(A295508_row(n), n=0..17);
    # Alternatively after formula:
    T := (n, k) -> `if`(k=0, n, n - 2^(k-1)):
    L := n -> nops(convert(n, base, 2)) - 0^n:
    T_row := n -> seq(T(n,k), k=0..L(n)):
    seq(T_row(n), n=0..17);

Formula

Let L(n) = (length of binary representation of n) - 0^n then
T(n, k) = n if k=0 else n - 2^(k-1) for n >= 0 and 0 <= k <= L(n).
Sum_{k=0..L(n)} T(n,k) = A123753(n-1) for n>=1.