Selected number
Sum of the row
Largest number

More information about Pascal's triangle

Pascal's triangle explorer

Start with a 1. Every row below begins and ends with 1, and every other number is the sum of the two numbers above it. That one rule builds Pascal's triangle, and with it a surprising amount of mathematics: the coefficients of (a + b)ⁿ, the number of ways to choose k things out of n, the powers of 2, the Fibonacci numbers and a fractal. Click any number to see where it comes from, then switch patterns to find what the triangle hides. Every number is the sum of the two numbers above it. Click a number, or use the arrow keys, to select it; choose a pattern to see what the triangle hides: the coefficients of (a + b)ⁿ and the powers of 2 in the rows, the hockey stick, the Fibonacci numbers on the shallow diagonals, the remainders that draw the Sierpiński triangle, and the triangular numbers. Press Build to grow the triangle one row at a time.

How it works

  1. Click a number in the triangle, or use the arrow keys, to see C(n, k), the two numbers it is the sum of and the sum of its row.
  2. Choose a pattern: rows and (a + b)ⁿ, the hockey stick, the Fibonacci diagonals, remainders or the counting and triangular numbers.
  3. Set the number of rows up to 64, and press Build to watch the triangle grow one row at a time.

Choosing and counting

The number in row n at place k, counting both from 0, is C(n, k) = n! / (k! (n − k)!): the number of ways to choose k things out of n. Row 4 reads 1, 4, 6, 4, 1, so there are 6 ways to pick two of four friends. The sum rule makes sense in these terms: to choose k from n, either take the last item and choose k − 1 from the rest, or leave it and choose all k from the rest. The same numbers expand (a + b)ⁿ, which is why they are called binomial coefficients, and each row adds up to 2ⁿ, the number of ways to choose any subset at all.

Patterns inside the triangle

Add the numbers down a diagonal from the edge, 1 + 3 + 6 + 10, and the total, 20, sits just below and to the side of the last one: the hockey stick. Add along the shallow diagonals and you get 1, 1, 2, 3, 5, 8, the Fibonacci numbers. The second diagonal counts 1, 2, 3, the third gives the triangular numbers 1, 3, 6, 10 and the fourth the tetrahedral numbers. Colour the odd numbers and the Sierpiński triangle appears; row n contains exactly 2 to the power of the number of 1s in n written in binary odd numbers.

Frequently asked questions

Why does every row add up to a power of 2?

Each number in row n counts the ways to choose some of n items, so the whole row counts every possible choice of any size. Every item is either in or out, which gives 2 × 2 × … × 2 = 2ⁿ choices. In the triangle you can also see it directly: every number is passed down to two numbers in the next row, so each row adds up to twice the row before.

What is the hockey stick identity?

Start at a 1 on the edge and add the numbers down the diagonal: 1 + 2 + 3 + 4 = 10, or 1 + 3 + 6 + 10 = 20. The total is always the number just below the last one, one step to the other side, so the diagonal and its total form a hockey stick. In symbols, C(k, k) + C(k + 1, k) + … + C(n, k) = C(n + 1, k + 1).

Where are the Fibonacci numbers?

On the shallow diagonals that go up one row and right one place at a time. Adding along them gives 1, 1, 2, 3, 5, 8, 13 and so on. Each diagonal is the sum of the two before it, for the same reason that each number in the triangle is the sum of the two above it.

How large do the numbers get?

The middle of row n grows almost as fast as 2ⁿ. Row 20 reaches 184,756, and the middle of row 63, the last row the explorer shows, is 916,312,070,471,295,267, an 18-digit number. The app computes every number exactly.

Who invented Pascal's triangle?

Not Pascal. The triangle was known centuries earlier: to al-Karaji and Omar Khayyam in Persia, to Jia Xian and Yang Hui in China, where it is called Yang Hui's triangle, and to Tartaglia in Italy. Blaise Pascal's treatise of 1654, published in 1665, gathered its properties and used them in probability, and his name stuck.

Pascal's Triangle Explorer: how do I record a video?

Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. You can add one of three music tracks: calm, bright or beat.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor