Skip to content

Pascal’s Triangle Calculator

Generate Pascal’s triangle, find any entry C(n, k) exactly, list a whole row, and expand (x + y)^n with the binomial theorem, with odd entries highlighted.

Calculator Details

C(6, 2):15See results ↓

Row number, counting the top 1 as row 0 (up to 1000)

Counting the first entry as position 0

1 to 30

Your Results

C(6, 2): 15

C(6, 2)

15

Entry 2 of row 6 (2 digits)

Sum of row 6

64

2^6

Largest entry in the row

20

C(6, 3)

Odd entries in the row

4

of 7

Entry 2 of row 6 of Pascal's triangle is C(6, 2) = 15. Row 6 has 7 entries adding up to 2^6 = 64, and 4 of them are odd.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Rows 0 to 9

Odd entries are shaded and underlined: together they form the Sierpiński triangle.

Row 0:1
Row 1:11
Row 2:121
Row 3:1331
Row 4:14641
Row 5:15101051
Row 6:1615201561
Row 7:172135352171
Row 8:18285670562881
Row 9:193684126126843691
Row 6: every entry C(6, k)
kC(6, k)
01
16
2 (yours)15
320
415
56
61
Terms of (x + y)^6
kC(n, k)Term
011 x^6 y^0
166 x^5 y^1
21515 x^4 y^2
32020 x^3 y^3
41515 x^2 y^4
566 x^1 y^5
611 x^0 y^6

How This Calculator Works

How it's calculated

Each entry is the sum of the two entries above it, and the edges are 1. Entry k of row n is the binomial coefficient C(n, k) = n! ÷ (k! × (n − k)!), the number of ways to choose k items from n. The calculator works with exact whole numbers of any length, so even row 1,000 has no rounding.

C(6, 2) = 6! ÷ (2! × 4!) = 15
Row sum: C(6, 0) + … + C(6, 6) = 2^6 = 64
(x + y)^6 = x^6 + 6x^5y + 15x^4y^2 + 20x^3y^3 + 15x^2y^4 + 6xy^5 + y^6

Frequently Asked Questions

How is Pascal’s triangle built?

Start with a 1 at the top (row 0). Each row begins and ends with 1, and every other number is the sum of the two numbers directly above it. Row 1 is 1 1, row 2 is 1 2 1, row 3 is 1 3 3 1 and row 4 is 1 4 6 4 1.

How do I find a number in Pascal’s triangle without drawing it?

Entry k of row n (both counted from 0) is the binomial coefficient C(n, k) = n! ÷ (k! × (n − k)!). For row 6, entry 2: 720 ÷ (2 × 24) = 15. Enter n and k and the calculator gives the exact value, even for rows in the hundreds where the numbers have hundreds of digits.

Why do the rows count from 0?

So that the row number matches the power in the binomial theorem and the n in C(n, k). Row 3 (1 3 3 1) gives the coefficients of (x + y)³, and its entries are C(3, 0) to C(3, 3). Counting the top row as row 1 shifts every formula by one.

What does the sum of a row equal?

Row n adds up to 2^n. Row 4 is 1 + 4 + 6 + 4 + 1 = 16 = 2⁴. The reason: C(n, k) counts the subsets of size k of a set of n items, and adding over all sizes counts every subset, of which there are 2^n.

How is Pascal’s triangle used for binomial expansion?

Row n gives the coefficients of (x + y)^n. For (x + y)⁴ the row is 1 4 6 4 1, so the expansion is x⁴ + 4x³y + 6x²y² + 4xy³ + y⁴. With other coefficients, such as (2x − 3y)⁴, each term also takes the powers of 2 and −3; set a and b under Advanced options to see them.

What is the Sierpiński pattern in the triangle?

If you shade the odd entries, the triangle breaks into the fractal Sierpiński triangle: triangles inside triangles, repeating every power of 2 rows. The number of odd entries in row n is 2 raised to the number of 1s in n written in binary, so row 7 (111 in binary) is all odd and row 8 (1000) has only its two end 1s odd.

What other patterns are in Pascal’s triangle?

The second diagonal is the counting numbers 1, 2, 3, 4…, the third the triangular numbers 1, 3, 6, 10…, and the fourth the tetrahedral numbers. Adding along shallow diagonals gives the Fibonacci numbers, and reading row n as digits (carrying over) gives 11^n for small n: 1 4 6 4 1 is 11⁴ = 14,641.

How is Pascal’s triangle used in probability?

C(n, k) is the number of ways to get exactly k heads in n coin tosses, so dividing row n by 2^n gives the probabilities. With 4 tosses the row 1 4 6 4 1 out of 16 says that 2 heads has a chance of 6/16 = 37.5%. The binomial distribution generalises this to any chance of success.

All entries are exact whole numbers (no rounding), for rows up to 1000. To keep the page fast, the triangle shows up to 30 rows, a whole row is listed up to row 100, and the binomial expansion is written out up to n = 50. Not included: negative or fractional powers (Newton's generalised binomial series), trinomial expansions such as (x + y + z)^n, and entries modulo a number other than 2.

Pascal’s Triangle Calculator: Rows, Entries C(n, k) and Binomial Expansion

By FindMySum · Last reviewed

Pascal's triangle is a triangular table of numbers in which every entry is the sum of the two above it. It looks like a simple pattern, but its entries are the binomial coefficients, which count combinations, give the coefficients of a binomial expansion and set the probabilities of coin tosses. This calculator builds the first rows, finds any entry exactly, lists a whole row, and expands (a·x + b·y)^n. Its opening example is row 6, entry 2.

Building the triangle

The top row, called row 0, is a single 1. Each row after it starts and ends with 1, and each number inside is the sum of the two numbers diagonally above:

  • Row 0: 1
  • Row 1: 1 1
  • Row 2: 1 2 1
  • Row 3: 1 3 3 1
  • Row 4: 1 4 6 4 1
  • Row 5: 1 5 10 10 5 1
  • Row 6: 1 6 15 20 15 6 1

Positions in a row are also counted from 0, so row 6, position 2 is 15. Counting from 0 makes the formulas line up with the binomial theorem; if you count from 1, subtract 1 from both numbers before using a formula.

The formula for any entry

You don't need to build the rows above to find an entry. Entry k of row n is the binomial coefficient:

C(n, k) = n! ÷ (k! × (n − k)!)

often read "n choose k" and written as n over k in brackets. For the default example: C(6, 2) = 720 ÷ (2 × 24) = 15, which matches row 6 above.

The addition rule and the formula agree because of Pascal's rule, C(n, k) = C(n − 1, k − 1) + C(n − 1, k): to choose k items from n, either you take the last item and choose k − 1 from the rest, or you leave it and choose all k from the rest.

The calculator works with exact whole numbers of any length. It computes a row with the shortcut C(n, k + 1) = C(n, k) × (n − k) ÷ (k + 1), which never needs a factorial, so row 1,000 is as exact as row 6.

Row sums and powers of two

Adding the entries of row n gives 2^n: row 6 adds to 1 + 6 + 15 + 20 + 15 + 6 + 1 = 64 = 2⁶. A set of n items has 2^n subsets, and row n counts them by size: one empty subset, n subsets of one item, C(n, 2) of two items, and so on. The alternating sum of a row (subtract every second entry) is always 0 for n ≥ 1.

Binomial expansion

The binomial theorem says:

(x + y)^n = C(n, 0)x^n + C(n, 1)x^(n−1)y + … + C(n, n)y^n

so row n holds the coefficients. Row 6 gives:

(x + y)⁶ = x⁶ + 6x⁵y + 15x⁴y² + 20x³y³ + 15x²y⁴ + 6xy⁵ + y⁶

The powers of x count down from n while the powers of y count up, and the two always add to n. When the terms have their own coefficients, they are raised to the same powers. For (2x − 3y)⁴, row 4 is 1 4 6 4 1 and each term k is multiplied by 2^(4−k) × (−3)^k:

(2x − 3y)⁴ = 16x⁴ − 96x³y + 216x²y² − 216xy³ + 81y⁴

Enter a and b under Advanced options to get any expansion of this form up to n = 50, with every term listed in a table.

Odd entries and the Sierpiński triangle

Shading the odd numbers in the triangle reveals a fractal: the Sierpiński triangle, a triangle with its middle removed, repeated inside each of the three corners, and so on. The calculator shades odd entries in the rows it shows. The pattern repeats every power of two: rows 0 to 3 form one copy, rows 0 to 7 three copies of it, rows 0 to 15 nine copies.

There is an exact count, due to James Glaisher in 1899: the number of odd entries in row n is 2 raised to the number of 1s in n written in binary. Row 6 is 110 in binary, with two 1s, so it has 2² = 4 odd entries (1, 15, 15, 1). Row 7 (111) has 8: every entry is odd. Row 8 (1000) has just 2, the ones at each end.

Other patterns

  • Diagonals. The edges are 1s, the next diagonal the counting numbers, then the triangular numbers (1, 3, 6, 10, 15…) and the tetrahedral numbers (1, 4, 10, 20…).
  • Fibonacci numbers. Adding along shallow diagonals gives 1, 1, 2, 3, 5, 8, 13…
  • Powers of 11. Rows 0 to 4 read as numbers are 1, 11, 121, 1331 and 14641, the powers of 11. From row 5 the entries have two digits, and you have to carry.
  • Probability. Row n divided by 2^n gives the chance of each number of heads in n fair coin tosses. Six tosses give exactly three heads 20 times in 64, or 31.25%.

Limits

To keep the page fast, the triangle shows up to 30 rows, a whole row is listed up to row 100 and expansions are written out up to n = 50. Any single entry, the row sum and the number of odd entries are available up to row 1,000.

More questions

Who invented Pascal’s triangle?

Blaise Pascal wrote about it in his Traité du triangle arithmétique (published 1665), but the triangle was known centuries earlier. The Persian mathematician al-Karaji and the poet Omar Khayyam described it around 1000 to 1100, and in China it is called Yang Hui’s triangle after the 13th-century mathematician who published it, crediting Jia Xian from the 11th century.

Is the triangle symmetrical?

Yes. Every row reads the same forwards and backwards, because choosing k items to take is the same as choosing the n − k items to leave: C(n, k) = C(n, n − k). That is why the largest entry sits in the middle of each row.

What is the hockey-stick pattern?

Start at a 1 on the edge, go down a diagonal any number of steps, and the sum of those entries equals the entry just below and to the other side of the last one. For example 1 + 3 + 6 + 10 = 20 (C(6, 3)). It is the identity Σ C(i, r) = C(n + 1, r + 1).

How big do the numbers in Pascal’s triangle get?

They grow quickly. Row 20’s middle entry is 184,756, row 100’s has 30 digits, and row 1,000’s middle entry C(1000, 500) has 300 digits. The middle entry of row n is roughly 2^n ÷ √(πn/2), so each row’s largest entry is roughly double the one in the row above.

Can Pascal’s triangle expand (x − y)^n?

Yes. Write it as (x + (−y))^n: the coefficients are the same, but every term with an odd power of y changes sign. (x − y)³ = x³ − 3x²y + 3xy² − y³. In the calculator, set b to −1 under Advanced options.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy