Prime numbers appear in Pascal’s triangle in a precise location. With the top numbered as row 0, a prime number p occurs as the second and second-to-last entry of row p. No entry farther inside the triangle can itself be prime.
Prime Number Pattern
For every prime p, Pascal’s triangle contains:
C(p, 1) = C(p, p − 1) = p
The prime 2 appears once because these two positions coincide in row 2. Every odd prime appears twice in its row because Pascal’s triangle is symmetric.
How Pascal’s Triangle Is Defined
Each entry in Pascal’s triangle is a binomial coefficient. The entry in row n and position k is written as C(n, k), where the positions begin with k = 0.
Binomial Coefficient Formula
C(n, k) = n! / (k!(n − k)!)
The two outer entries satisfy C(n, 0) = C(n, n) = 1, while the entries beside them satisfy C(n, 1) = C(n, n − 1) = n.
This immediately connects row numbers with prime numbers. When n is prime, the two entries next to the outer 1s are prime. When n is composite, those entries are composite.
Prime Entries in the First Rows
| Row | Entries | Prime Entries |
|---|---|---|
| 0 | 1 | None |
| 1 | 1, 1 | None |
| 2 | 1, 2, 1 | 2 |
| 3 | 1, 3, 3, 1 | 3, 3 |
| 4 | 1, 4, 6, 4, 1 | None |
| 5 | 1, 5, 10, 10, 5, 1 | 5, 5 |
| 6 | 1, 6, 15, 20, 15, 6, 1 | None |
| 7 | 1, 7, 21, 35, 35, 21, 7, 1 | 7, 7 |
| 11 | 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1 | 11, 11 |
The composite-numbered rows shown in the table contain no prime entries. They can contain numbers with prime factors, such as 15 = 3 × 5 in row 6, but the entries themselves remain composite.
Why Prime Numbers Occur Near the Edges
The entries immediately beside the outer 1s always equal the row number:
Left Side
C(n, 1) = n
Right Side
C(n, n − 1) = n
If the row number is 13, those entries are both 13. If the row number is 14, they are both 14. The primality of these entries therefore depends entirely on whether the row number is prime or composite.
This gives an exact classification:
- Row 2 contains the prime entry 2 once.
- Every odd prime-numbered row contains that prime twice.
- Every composite-numbered row greater than 1 contains no prime entries.
Why Deeper Entries Cannot Be Prime
Consider an entry C(n, k) with 2 ≤ k ≤ n − 2. These are the entries beyond the two positions beside the edges.
For n ≥ 4, every entry in this deeper region is at least as large as:
Smallest Deeper Entry
C(n, 2) = n(n − 1) / 2
This value is greater than n. For example, C(7, 2) = 21, which is larger than 7.
At the same time, C(n, k) is a divisor of n!, because:
C(n, k) × k! × (n − k)! = n!
Every prime factor of n! is at most n. Therefore, if C(n, k) were itself prime, it would have to be at most n. A deeper entry is greater than n, so it cannot be prime.
Result
The only possible prime entries in Pascal’s triangle are C(n, 1) and C(n, n − 1). They are prime exactly when n is prime.
Every Prime Appears in Its Own Row
Every prime number occurs somewhere in Pascal’s triangle. A prime p appears in row p because:
C(p, 1) = p
It cannot appear as a prime entry in any other row.
In a row numbered below p, any prime divisor of an entry is no greater than the row number, so an entry cannot equal p. In a row numbered above p, the entries beside the edges equal the larger row number, while deeper entries are even larger.
Prime 2
Appears once in row 2 because the two symmetric positions are the same position.
Odd Primes
Each odd prime appears twice, in symmetric positions in its own row.
Composite values occur throughout the triangle, including both near the edges and deeper inside.
Divisibility in Prime-Numbered Rows
A prime-numbered row has another notable property. If p is prime, every entry between the two outer 1s is divisible by p:
Prime Row Divisibility
p divides C(p, k) for 1 ≤ k ≤ p − 1
Row 7 provides a small example:
1, 7, 21, 35, 35, 21, 7, 1
Each non-edge entry is divisible by 7. The same pattern occurs in row 5, where 5 divides 5 and 10, and in row 11, where 11 divides 11, 55, 165, 330, and 462.
The factorial formula explains why. In C(p, k), the numerator p! contains the prime factor p. When 1 ≤ k ≤ p − 1, neither k! nor (p − k)! contains a factor equal to p, so that factor remains in the binomial coefficient.
Pascal’s Triangle Modulo a Prime
When the entries of row p are reduced modulo the prime p, all interior values become 0. Only the two outer 1s remain nonzero:
Row p modulo p: 1, 0, 0, …, 0, 1
For row 5:
1, 5, 10, 10, 5, 1 ≡ 1, 0, 0, 0, 0, 1 (mod 5)
This is equivalent to the polynomial congruence:
Binomial Congruence
(x + y)p ≡ xp + yp (mod p)
The missing mixed terms have coefficients divisible by p. This property is often used in number theory and arithmetic modulo a prime.
Prime Entries and Prime Factors Are Different
Common Mistake
A composite entry can contain prime factors without being a prime number. The entry 35 in row 7 is divisible by the row prime 7, but 35 is composite because 35 = 5 × 7.
Prime-numbered rows contain many multiples of their row prime, not many prime entries. Only the two entries equal to the row number can be prime.
| Entry | Location | Classification |
|---|---|---|
| 7 | C(7, 1) | Prime |
| 21 | C(7, 2) | Composite; divisible by 7 |
| 35 | C(7, 3) | Composite; divisible by 7 |
| 11 | C(11, 1) | Prime |
| 55 | C(11, 2) | Composite; divisible by 11 |
Row Numbering Changes the Label, Not the Pattern
Two row-numbering conventions are commonly used. Mathematicians often call the top row row 0 because its only entry is C(0, 0). Some diagrams call the top row row 1.
Zero-Based Numbering
Prime p appears in row p.
One-Based Numbering
Prime p appears in the displayed row numbered p + 1.
For example, the row 1, 5, 10, 10, 5, 1 is row 5 under zero-based numbering and the sixth displayed row under one-based numbering.
Related Mathematical Ideas
Frequently Asked Questions
Where Do Prime Numbers Appear in Pascal’s Triangle?
With zero-based row numbering, a prime p appears at C(p, 1) and C(p, p − 1). These are the two entries immediately beside the outer 1s.
Can a Prime Number Appear in the Middle of Pascal’s Triangle?
No. Entries with 2 ≤ k ≤ n − 2 are composite. They are greater than the row number, while all their prime factors are no greater than the row number.
Does Every Prime Number Appear in Pascal’s Triangle?
Yes. Every prime p appears in row p. The prime 2 appears once, while each odd prime appears twice because of the triangle’s symmetry.
Do Composite-Numbered Rows Contain Prime Entries?
No. Their entries beside the edges equal the composite row number, and all entries farther inside are also composite.
Why Are All Interior Entries of a Prime Row Divisible by the Row Number?
For a prime p, the numerator of C(p, k) contains a factor p, while the denominator contains no factor p when 1 ≤ k ≤ p − 1.
Is 1 a Prime Number in Pascal’s Triangle?
No. The outer edges of Pascal’s triangle consist entirely of 1s, but 1 is not prime because it has only one positive divisor.
Why Do Some Diagrams Place Prime p in Row p + 1?
Those diagrams number the top as row 1. Under the zero-based convention used for binomial coefficients, the top is row 0 and prime p appears in row p.