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.

A174346 Triangle T(n, k) = (binomial(n-1, k-1)*binomial(n, k-1)/k) * ( 3^(k-1) if floor(n/2) >= k, otherwise 3^(n-k) ), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 9, 1, 1, 18, 18, 1, 1, 30, 180, 30, 1, 1, 45, 450, 450, 45, 1, 1, 63, 945, 4725, 945, 63, 1, 1, 84, 1764, 13230, 13230, 1764, 84, 1, 1, 108, 3024, 31752, 142884, 31752, 3024, 108, 1, 1, 135, 4860, 68040, 428652, 428652, 68040, 4860, 135, 1
Offset: 1

Views

Author

Roger L. Bagula, Mar 16 2010

Keywords

Examples

			Triangle begins as:
  1;
  1,   1;
  1,   9,    1;
  1,  18,   18,     1;
  1,  30,  180,    30,      1;
  1,  45,  450,   450,     45,      1;
  1,  63,  945,  4725,    945,     63,     1;
  1,  84, 1764, 13230,  13230,   1764,    84,    1;
  1, 108, 3024, 31752, 142884,  31752,  3024,  108,   1;
  1, 135, 4860, 68040, 428652, 428652, 68040, 4860, 135, 1;
		

Crossrefs

Cf. A081582.

Programs

  • Magma
    function T(n,k)
      if Floor(n/2) gt k-1 then return (1/n)*Binomial(n,k)*Binomial(n,k-1)*3^(k-1);
      else return (1/n)*Binomial(n,k)*Binomial(n,k-1)*3^(n-k);
      end if; return T;
    end function;
    [T(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Nov 26 2021
    
  • Mathematica
    T[n_,k_]:= (Binomial[n-1, k-1]*Binomial[n, k-1]/k)*If[Floor[n/2]>k-1, 3^(k-1), 3^(n-k)];
    Table[T[n,k], {n,12}, {k,n}]//Flatten
  • Sage
    def A174346(n,k): return (1/n)*binomial(n,k)*binomial(n,k-1)*( 3^(k-1) if ((n//2)>k-1) else 3^(n-k) )
    flatten([[A174346(n,k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Nov 26 2021

Formula

T(n, k) = (binomial(n-1, k-1)*binomial(n, k-1)/k) * ( 3^(k-1) if floor(n/2) >= k, otherwise 3^(n-k) ).
T(n, n-k) = T(n, k).

Extensions

Edited by G. C. Greubel, Nov 26 2021