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.

Showing 1-2 of 2 results.

A227550 A triangle formed like Pascal's triangle, but with factorial(n) on the borders instead of 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 6, 4, 4, 6, 24, 10, 8, 10, 24, 120, 34, 18, 18, 34, 120, 720, 154, 52, 36, 52, 154, 720, 5040, 874, 206, 88, 88, 206, 874, 5040, 40320, 5914, 1080, 294, 176, 294, 1080, 5914, 40320, 362880, 46234, 6994, 1374, 470, 470, 1374, 6994, 46234, 362880, 3628800
Offset: 0

Views

Author

Vincenzo Librandi, Aug 04 2013

Keywords

Comments

A003422 gives the second column (after 0).

Examples

			Triangle begins:
       1;
       1,     1;
       2,     2,    2;
       6,     4,    4,    6;
      24,    10,    8,   10,  24;
     120,    34,   18,   18,  34, 120;
     720,   154,   52,   36,  52, 154,  720;
    5040,   874,  206,   88,  88, 206,  874, 5040;
   40320,  5914, 1080,  294, 176, 294, 1080, 5914, 40320;
  362880, 46234, 6994, 1374, 470, 470, 1374, 6994, 46234, 362880;
		

Crossrefs

Cf. similar triangles with t on the borders: A007318 (t = 1), A028326 (t = 2), A051599 (t = prime(n)), A051601 (t = n), A051666 (t = n^2), A108617 (t = fibonacci(n)), A134636 (t = 2n+1), A137688 (t = 2^n), A227075 (t = 3^n).
Cf. A003422.
Cf. A227791 (central terms), A001563, A074911.

Programs

  • Haskell
    a227550 n k = a227550_tabl !! n !! k
    a227550_row n = a227550_tabl !! n
    a227550_tabl = map fst $ iterate
       (\(vs, w:ws) -> (zipWith (+) ([w] ++ vs) (vs ++ [w]), ws))
       ([1], a001563_list)
    -- Reinhard Zumkeller, Aug 05 2013
    
  • Magma
    function T(n,k)
      if k eq 0 or k eq n then return Factorial(n);
      else return T(n-1,k-1) + T(n-1,k);
      end if; return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 02 2021
    
  • Mathematica
    t = {}; Do[r = {}; Do[If[k == 0||k == n, m = n!, m = t[[n, k]] + t[[n, k + 1]]]; r = AppendTo[r, m], {k, 0, n}]; AppendTo[t, r], {n, 0, 10}]; t = Flatten[t]
  • Sage
    def T(n,k): return factorial(n) if (k==0 or k==n) else T(n-1, k-1) + T(n-1, k)
    flatten([[T(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 02 2021

Formula

From G. C. Greubel, May 02 2021: (Start)
T(n, k) = T(n-1, k-1) + T(n-1, k) with T(n, 0) = T(n, n) = n!.
Sum_{k=0..n} T(n, k) = 2^n * (1 +Sum_{j=1..n-1} j*j!/2^j) = A140710(n). (End)

A140709 Triangle read by rows: T(n,k) is the number of deco polyominoes of height n in which the maximal number of initial consecutive columns ending at the same level is k (1 <= k <= n).

Original entry on oeis.org

1, 1, 1, 3, 2, 1, 15, 5, 3, 1, 87, 20, 8, 4, 1, 567, 107, 28, 12, 5, 1, 4167, 674, 135, 40, 17, 6, 1, 34407, 4841, 809, 175, 57, 23, 7, 1, 316647, 39248, 5650, 984, 232, 80, 30, 8, 1, 3219687, 355895, 44898, 6634, 1216, 312, 110, 38, 9, 1, 35878887, 3575582, 400793, 51532, 7850, 1528, 422, 148, 47, 10, 1
Offset: 1

Views

Author

Emeric Deutsch, Jun 03 2008

Keywords

Comments

A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column.

Examples

			T(2,1)=1 (the vertical domino); T(2,2)=1 (the horizontal domino); T(3,1)=3 because we have (3), (1,2) and (2,1,1), where (a,b,c,...) stands for a polyomino with columns of lengths a,b,c,..., starting at level 0.
Triangle starts:
    1;
    1,   1;
    3,   2,   1;
   15,   5,   3,   1;
   87,  20,   8,   4,   1;
  567, 107,  28,  12,   5,   1;
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) options operator, arrow: binomial(n-1, k-1)+sum(factorial(j)*(j-1)*binomial(n-1-j, k-1),j=2..n-1) end proc: for n to 11 do seq(T(n, k),k=1..n) end do; # yields sequence in triangular form
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==1, n! -Sum[j!, {j,n-1}], T[n-1, k] + T[n-1, k-1] ]];
    Table[T[n, k], {n,14}, {k,n}]//Flatten (* G. C. Greubel, May 02 2021 *)
  • PARI
    T(n,k) = binomial(n-1, k-1) + sum(j=2, n-1, j!*(j-1)*binomial(n-1-j, k-1));
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Nov 16 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k < 0 or k > n): return 0
        elif (k==1): return factorial(n) - sum(factorial(j) for j in (1..n-1))
        else: return T(n-1, k-1) + T(n-1, k)
    flatten([[T(n, k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, May 02 2021

Formula

T(n,k) = binomial(n-1, k-1) + Sum_{j=2..n-1} j!*(j-1)*binomial(n-1-j, k-1).
T(n,k) = T(n-1, k) + T(n-1, k-1) for n,k >= 2.
Sum of entries in row n is n! (A000142).
T(n,1) = A132371(n).
Sum_{k=1..n} k*T(n,k) = A140710(n).
Showing 1-2 of 2 results.