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.

A166556 Triangle read by rows, A000012 * A047999.

Original entry on oeis.org

1, 2, 1, 3, 1, 1, 4, 2, 2, 1, 5, 2, 2, 1, 1, 6, 3, 2, 1, 2, 1, 7, 3, 3, 1, 3, 1, 1, 8, 4, 4, 2, 4, 2, 2, 1, 9, 4, 4, 2, 4, 2, 2, 1, 1, 10, 5, 4, 2, 4, 2, 2, 1, 2, 1, 11, 5, 5, 2, 4, 2, 2, 1, 3, 1, 1, 12, 6, 6, 3, 4, 2, 2, 1, 4, 2, 2, 1
Offset: 0

Views

Author

Gary W. Adamson, Oct 17 2009

Keywords

Examples

			First few rows of the triangle =
   1;
   2, 1;
   3, 1, 1;
   4, 2, 2, 1;
   5, 2, 2, 1, 1;
   6, 3, 2, 1, 2, 1;
   7, 3, 3, 1, 3, 1, 1;
   8, 4, 4, 2, 4, 2, 2, 1;
   9, 4, 4, 2, 4, 2, 2, 1, 1;
  10, 5, 4, 2, 4, 2, 2, 1, 2, 1;
  11, 5, 5, 2, 4, 2, 2, 1, 3, 1, 1;
  12, 6, 6, 3, 4, 2, 2, 1, 4, 2, 2, 1;
  13, 6, 6, 3, 5, 2, 2, 1, 5, 2, 2, 1, 1;
  ...
		

Crossrefs

Sums include: A006046 (row), A007729 (diagonal).

Programs

  • Magma
    A166556:= func< n,k | (&+[(Binomial(j,k) mod 2): j in [k..n]]) >;
    [A166556(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 02 2024
    
  • Maple
    A166556 := proc(n,k)
        local j;
        add(A047999(j,k),j=k..n) ;
    end proc: # R. J. Mathar, Jul 21 2016
  • Mathematica
    A166556[n_, k_]:= Sum[Mod[Binomial[j,k], 2], {j,k,n}];
    Table[A166556[n,k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 02 2024 *)
  • Python
    def A166556(n,k): return sum(binomial(j,k)%2 for j in range(k,n+1))
    print(flatten([[A166556(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Dec 02 2024

Formula

Triangle read by rows, A000012 * A047999; where A000012 = an infinite lower triangular matrix with all 1's: [1; 1,1; 1,1,1;..]; and A047999 = Sierpinski's gasket.
The operation takes partial sums of Sierpinski's gasket terms, by columns.
From G. C. Greubel, Dec 02 2024: (Start)
T(n, k) = Sum_{j=k..n} (binomial(j,k) mod 2).
T(n, 0) = A000027(n+1).
T(n, 1) = A004526(n+1).
T(n, 2) = A004524(n+1).
T(2*n, n) = A080100(n).
Sum_{k=0..n} T(n, k) = A006046(n+1).
Sum_{k=0..n} (-1)^k*T(n, k) = A006046(floor(n/2)+1).
Sum_{k=0..floor(n/2)} T(n-k, k) = A007729(n). (End)