Pascal's Triangle Generator – Build Rows and Look Up C(n,k)
Pascal's triangle is a triangular array of binomial coefficients. Row n lists the values C(n,0) through C(n,n), where C(n,k) = n! / (k!(n−k)!) counts the number of ways to choose k items from a set of n. Every interior entry equals the sum of the two entries directly above it — the same additive rule this generator uses to build the full triangle, edge to edge, using exact BigInt arithmetic so there is no floating-point rounding even at high row counts.
Two Ways to Compute
Building the whole triangle is efficient with the additive rule C(n,k) = C(n−1,k−1) + C(n−1,k), since every entry is a single addition once the row above is known. But if you only need one value — say C(20,6) — there's no need to build 20 rows first. The multiplicative formula C(n,k) = (n·(n−1)·...·(n−k+1)) / k! computes a single entry directly, and this tool automatically uses the symmetry C(n,k) = C(n,n−k) to multiply through whichever of k or n−k is smaller.
Row Sums and Powers of Two
Every row of Pascal's triangle sums to a power of two: Σ C(n,k) = 2ⁿ. This makes sense combinatorially — the entries in row n count every way to choose a subset of any size from n items, and there are exactly 2ⁿ subsets total. The Row Sum highlight mode computes both sides and confirms the identity for the row you choose.
The Sierpiński Triangle Hidden in the Parity
Coloring each entry by whether C(n,k) is odd or even reveals the Sierpiński triangle fractal once enough rows are drawn. This isn't a coincidence — by Kummer's theorem (equivalently, a bitwise reading of Lucas' theorem), C(n,k) is odd exactly when every binary digit of k is less than or equal to the corresponding digit of n, i.e. when (n & k) === k in binary. The parity highlight computes this bitwise test cell by cell instead of the full value, so it stays fast even at large row counts.
Diagonals and the Fibonacci Sequence
The "shallow" diagonals that run up and to the right through the triangle — where the row and column indices add to a constant n + k = m — sum to the Fibonacci numbers. Summing along the diagonal for m = 0, 1, 2, ... gives 1, 1, 2, 3, 5, 8, ..., matching F(m+1) in the standard Fibonacci sequence. The diagonal highlight lists each term in the sum and checks it against the Fibonacci number it should equal.
The Hockey Stick Identity
Running a finger down one diagonal of the triangle and then bending sideways into the next row traces a hockey-stick shape — hence the name. Algebraically, Σ (i = r to n) C(i,r) = C(n+1, r+1): summing a run of entries along a diagonal equals the single entry just below and to the right of where the run ends. The hockey stick mode highlights the run and the target cell together and verifies both sides are equal.
Reading Very Large Entries
Central entries grow quickly — row 60 already exceeds Number.MAX_SAFE_INTEGER. Because every computation uses BigInt internally, the exact value is always preserved; the scientific-notation display option simply controls whether large numbers are shown compactly (e.g. 1.379e+58) or in full, comma-separated form.
(x + y)⁵, pair it with the Binomial Expansion Calculator.