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.

A259342 Irregular triangle read by rows: T(n,k) = number of equivalence classes of binary sequences of length n containing exactly 2k ones.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 3, 1, 1, 3, 4, 1, 1, 4, 8, 4, 1, 1, 4, 10, 7, 1, 1, 5, 16, 16, 5, 1, 1, 5, 20, 26, 10, 1, 1, 6, 29, 50, 29, 6, 1, 1, 6, 35, 76, 57, 14, 1, 1, 7, 47, 126, 126, 47, 7, 1, 1, 7, 56, 185, 232, 111, 19, 1, 1, 8, 72, 280, 440, 280, 72, 8, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jun 27 2015

Keywords

Examples

			Triangle begins:
  1;
  1, 1;
  1, 1;
  1, 2,  1;
  1, 2,  1;
  1, 3,  3,   1;
  1, 3,  4,   1;
  1, 4,  8,   4,   1;
  1, 4, 10,   7,   1;
  1, 5, 16,  16,   5,  1;
  1, 5, 20,  26,  10,  1;
  1, 6, 29,  50,  29,  6, 1;
  1, 6, 35,  76,  57, 14, 1;
  1, 7, 47, 126, 126, 47, 7, 1;
  ...
		

Crossrefs

Row sums are (essentially) A000011.

Programs

  • Maple
    with(numtheory):
    T:= (n, k)-> (add(`if`(irem(2*k*d, n)=0, phi(n/d)
         *binomial(d, 2*k*d/n), 0), d=divisors(n))
         +n*binomial(iquo(n, 2), k))/(2*n):
    seq(seq(T(n, k), k=0..n/2), n=1..20);  # Alois P. Heinz, Jun 28 2015
  • Mathematica
    T[n_, k_] := (DivisorSum[n, If[Mod[2k*#, n]==0, EulerPhi[n/#]*Binomial[#, 2k*#/n], 0]&] + n*Binomial[Quotient[n, 2], k])/(2n); Table[T[n, k], {n, 1, 20}, { k, 0, n/2}] // Flatten (* Jean-François Alcover, Feb 28 2017, after Alois P. Heinz *)

Formula

Theorem 1 of Hoskins-Street gives an explicit formula.