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.

A166454 Triangle read by rows: T(n, k) = (1/2)*(A007318(n,k) - A047999(n,k)).

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 2, 5, 5, 2, 3, 7, 10, 7, 3, 3, 10, 17, 17, 10, 3, 4, 14, 28, 35, 28, 14, 4, 4, 18, 42, 63, 63, 42, 18, 4, 5, 22, 60, 105, 126, 105, 60, 22, 5, 5, 27, 82, 165, 231, 231, 165, 82, 27, 5, 6, 33, 110, 247, 396, 462, 396, 247, 110, 33, 6
Offset: 2

Views

Author

Gary W. Adamson, Oct 14 2009

Keywords

Comments

Row sums = A120739: (1, 2, 7, 14, 30, 60, 127, 254, ...).

Examples

			First few rows of the triangle:
  1;
  1,   1;
  2,   3,   2;
  2,   5,   5,   2;
  3,   7,  10,   7,   3;
  3,  10,  17,  17,  10,   3;
  4,  14,  28,  35,  28,  14,   4;
  4,  18,  42,  63,  63,  42,  18,   4;
  5,  22,  60, 105, 126, 105,  60,  22,   5;
  5,  27,  82, 165, 231, 231, 165,  82,  27,   5;
  6,  33, 110, 247, 396, 462, 396, 247, 110,  33,   6;
  ...
		

Crossrefs

Cf. A007318, A011848, A001700 (central terms).

Programs

  • GAP
    Flat(List([2..12],n->List([1..n-1],m->Int(Binomial(n,m)/2)))); # Muniru A Asiru, Apr 14 2019
    
  • Haskell
    Following Bagula's formula
    a166454 n k = a166454_tabl !! (n-2) !! (k-1)
    a166454_row n = a166454_tabl !! (n-2)
    a166454_tabl = map (map (flip div 2) . init . tail) $ drop 2 a007318_tabl
    -- Reinhard Zumkeller, Mar 04 2015
    
  • Magma
    [[Floor(Binomial(n,k)/2): k in [1..n-1]]: n in [2..12]]; // G. C. Greubel, Apr 16 2019
    
  • Maple
    seq(seq(floor(binomial(n,m)/2),m=1..n-1),n=2..12); # Muniru A Asiru, Apr 14 2019
  • Mathematica
    T[n_, m_] = Floor[Binomial[n, m]/2]; Table[T[n, m], {n, 2, 12}, {m, 1, n-1}]//Flatten (* Roger L. Bagula, Mar 07 2010*)
  • PARI
    {T(n,k) = binomial(n,k)\2 };
    for(n=2,12, for(k=1,n-1, print1(T(n,k), ", "))) \\ G. C. Greubel, Apr 16 2019
    
  • Sage
    [[floor(binomial(n,k)/2) for k in (1..n-1)] for n in (2..12)] # G. C. Greubel, Apr 16 2019

Formula

T(n, k) = (1/2)*(A007318(n,k) - A047999(n,k)), nonzero terms.
T(n, m) = floor(binomial(n, m)/2). - Roger L. Bagula, Mar 07 2010