Pascal’s triangle is a triangular table of numbers in which each entry is the sum of the two entries above it. Simple as that rule is, the triangle holds the binomial coefficients, the counts of combinations, the powers of 2, the triangular numbers, the Fibonacci numbers and a famous fractal. This calculator draws the triangle up to 30 rows, gives any single row up to row 1,000 with every digit exact, and colors entries by divisibility so the patterns stand out.
How to use the Pascal’s triangle calculator
- Under Show, choose Triangle, One row or Divisibility pattern.
- For the triangle, enter the Number of rows (1 to 30). Tick Highlight odd numbers to shade the odd entries. Hover over a number to see its C(n, k) label.
- For a single row, enter the Row number (n). Optionally enter a Position in the row (k) to get that entry exactly on the tape; leave it blank for the middle entry.
- For the pattern, enter up to 128 rows and a Divisor (m). Entries that are not multiples of m are colored, and the rest are gray.
Pascal’s triangle formula
Each entry is a binomial coefficient, and neighboring entries satisfy Pascal’s rule:
To build one row on its own, move left to right with
which is how the calculator produces row 1,000 without computing any huge factorial.
Worked example: row 10
Start with 1 and apply the row rule for n = 10:
1 × 10 ÷ 1 = 10, 10 × 9 ÷ 2 = 45, 45 × 8 ÷ 3 = 120, 120 × 7 ÷ 4 = 210, 210 × 6 ÷ 5 = 252
The row is symmetric, so row 10 is 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1.
Check: the numbers add to 1,024 = 210.
The middle entry, 252 = C(10, 5), is the number of ways to choose 5 items from 10, which you can confirm with the combinations calculator.
Patterns hidden in the triangle
- Diagonals. The outer diagonals are all 1s. The next diagonal is 1, 2, 3, 4, … (the counting numbers), then 1, 3, 6, 10, 15, … (the triangular numbers), then 1, 4, 10, 20, 35, … (the tetrahedral numbers).
- Hockey stick. Add entries down a diagonal and the total sits just below the end, off to the side: 1 + 3 + 6 = 10, that is C(2, 2) + C(3, 2) + C(4, 2) = C(5, 3).
- Fibonacci numbers. Sums along the shallow diagonals give 1, 1, 2, 3, 5, 8, 13, … — the Fibonacci sequence.
- Powers of 11. Rows 0 to 4 read as numbers are 1, 11, 121, 1331 and 14641, the powers of 11. From row 5 on, carrying digits breaks the pattern.
- Odd entries. Row n has 2ˢ odd numbers, where s is the number of 1s in n written in binary. Row 10 is 1010 in binary, so it has 2² = 4 odd entries: 1, 45, 45, 1.
- Primes. If n is prime, every entry of row n except the two 1s is divisible by n, as row 7 (1, 7, 21, 35, 35, 21, 7, 1) shows.
Binomial expansion
Row n gives the coefficients of (a + b)ⁿ:
Setting a = b = 1 shows again why row 5 adds up to 2⁵ = 32. Setting a = 1 and b = −1 shows the alternating sum of any row after row 0 is 0.
The divisibility pattern
Coloring the entries that are not divisible by 2 draws the Sierpiński triangle: the first 2ᵏ rows hold exactly 3ᵏ odd numbers, so 32 rows contain 243 odd entries out of 528. Prime divisors such as 3 or 5 give their own self-similar patterns, a consequence of Lucas’s theorem on binomial coefficients modulo a prime.
A triangle with many discoverers
The triangle is named after Blaise Pascal, whose Traité du triangle arithmétique was written in 1654 and published in 1665; he used it to solve problems about dividing the stakes of an unfinished game, an early step in probability theory. It was known much earlier: the Chinese mathematician Yang Hui described it in 1261, crediting the eleventh-century scholar Jia Xian, and it appears in the work of al-Karaji and Omar Khayyam in Persia. In China it is still called Yang Hui’s triangle, and in Italy Tartaglia’s triangle.
Frequently asked questions
How is Pascal's triangle built?
Start with a single 1 at the top (row 0). Each row begins and ends with 1, and every other number is the sum of the two numbers diagonally above it. Row 4, for example, is 1, 4, 6, 4, 1.
How do I find a number in Pascal's triangle without drawing it?
The number in row n at position k, both counted from 0, is the binomial coefficient C(n, k) = n! ÷ (k!(n − k)!). The middle of row 10 is C(10, 5) = 252.
Why does each row add up to a power of 2?
Every number is passed down to the two numbers below it, so each row's total is exactly double the row above. Starting from 1 in row 0, row n adds up to 2ⁿ. It also counts subsets: an n-item set has 2ⁿ subsets.
What does Pascal's triangle have to do with (a + b)ⁿ?
Row n lists the coefficients of the expanded power. (a + b)³ = a³ + 3a²b + 3ab² + b³ uses row 3: 1, 3, 3, 1.
Why do the odd numbers form the Sierpiński triangle?
Working modulo 2, the addition rule becomes exclusive-or, and the first 2ᵏ rows split into three copies of the first 2ᵏ⁻¹ rows with an all-even triangle in the middle. Repeating that split forever produces the Sierpiński pattern.