A046816 Pascal's tetrahedron: entries in 3-dimensional version of Pascal triangle, or trinomial coefficients.
1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 3, 3, 3, 6, 3, 1, 3, 3, 1, 1, 4, 4, 6, 12, 6, 4, 12, 12, 4, 1, 4, 6, 4, 1, 1, 5, 5, 10, 20, 10, 10, 30, 30, 10, 5, 20, 30, 20, 5, 1, 5, 10, 10, 5, 1, 1, 6, 6, 15, 30, 15, 20, 60, 60, 20, 15, 60, 90, 60, 15, 6, 30, 60, 60, 30, 6, 1, 6, 15, 20, 15, 6, 1
Offset: 0
Examples
The first few slices of the tetrahedron (or pyramid) are: 1 ----------------- 1 1 1 ----------------- 1 2 2 1 2 1 ----------------- 1 .... Here is the third slice of the pyramid 3 3 3 6 3 1 3 3 1 ---------------- ...
References
- Marco Costantini: Metodo per elevare qualsiasi trinomio a qualsiasi potenza. Archimede, rivista per gli insegnanti e i cultori di matematiche pure e applicate, anno XXXVIII ottobre-dicembre 1986, pp. 205-209. [Vincenzo Librandi, Jul 19 2009]
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10659
- Eitan Y. Levine, Vertical sums
- Wikipedia, Pascal's pyramid
- Index entries for sequences related to 3D arrays of numbers
Crossrefs
Programs
-
Haskell
a046816 n = a046816_list !! n a046816_list = concat $ concat $ iterate ([[1],[1,1]] *) [1] instance Num a => Num [a] where fromInteger k = [fromInteger k] (p:ps) + (q:qs) = p + q : ps + qs ps + qs = ps ++ qs (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs * = [] -- Reinhard Zumkeller, Apr 02 2011
-
Maple
p:= proc(i, j, k) option remember; if k<0 or i<0 or i>k or j<0 or j>i then 0 elif {i, j, k}={0} then 1 else p(i, j, k-1) +p(i-1, j, k-1) +p(i-1, j-1, k-1) fi end: seq(seq(seq(p(i, j, k), j=0..i), i=0..k), k=0..10); # Alois P. Heinz, Apr 03 2011
-
Mathematica
p[i_, j_, k_] := p[i, j, k] = Which[ k<0 || i<0 || i>k || j<0 || j>i, 0, {i, j, k} == {0, 0, 0}, 1, True, p[i, j, k-1] + p[i-1, j, k-1] + p[i-1, j-1, k-1]]; Table[p[i, j, k], {k, 0, 6}, {i, 0, k}, {j, 0, i}] // Flatten (* Jean-François Alcover, Dec 31 2012, translated from Alois P. Heinz's Maple program *) (* or *) Flatten[CoefficientList[CoefficientList[CoefficientList[Series[1/(1-x-x*y-x*y*z), {x, 0, 6}], x], y],z]] (* Georg Fischer, May 29 2019 *)
-
Python
from math import comb as C def T(n, j, k): return C(n, j) * C(n-j, k) print([T(n, r-c, c) for n in range(7) for r in range(n+1) for c in range(r+1)]) # Michael S. Branicky, Dec 26 2024
Formula
Coefficients of x, y, z in (x+y+z)^n: Let T'(n; i,j,k) := T(n, j,k) where i = n-(j+k). Then T'(n+1; i,j,k) = T'(n; i-1,j,k)+T'(n; i,j-1,k)+T'(n; i,j,k-1), T'(n; i,j,-1) := 0, T'(n; i,j,k) is invariant under permutations of (i,j,k); T'(0, 0, 0)=1.
T'(n; i,j,k) = n!/(i!*j!*k!) and (x+y+z)^n = Sum_{i+j+k=n; 0 <= i,j,k <= n} T'(n; i,j,k)*x^i*y^j*z^k. Hence Sum_{i+j+k=n; 0 <= i,j,k <= n} T'(n; i,j,k) = 3^n. - Gregory Gerard Wojnar, Oct 08 2020
G.f.: 1/(1-x-x*y-x*y*z). - Georg Fischer, May 29 2019
T(n,j,k) = C(n,j) * C(n-j,k), where C(a,b) are the binomial coefficients, elements of A007318. In particular, T(n,j,0) = C(n,j). - Eitan Y. Levine, Jul 22 2023
(-1)^n * Sum_{i=ceiling(n/k)..n} (-1)^i * T(i*k,n-i,i) = k^n, for n,k > 0. - Eitan Y. Levine, Aug 31 2023
Comments