Problem 24 · 2026 AMC 8
Stretch
Number Theory
legendre-formula
The notation n! is the product of the first n positive integers. Define the superfactorial of n to be the product of the factorials 1! · 2! · 3! · … · n! (so the superfactorial of 3 is 1! · 2! · 3! = 12). How many factors of 7 appear in the prime factorization of the superfactorial of 51?
Show answer
Answer: E — 171.
Show hints
Hint 1 of 2
The superfactorial is a product of factorials, and exponents add across a product. So the total number of 7s is just the sum of the 7-counts of 1!, 2!, …, 51! — turn one big product into a sum.
Still stuck? Show hint 2 →
Hint 2 of 2
Count the 7s in a single k! with Legendre's formula: ⌊k/7⌋ + ⌊k/49⌋ (multiples of 7 give one, multiples of 49 give an extra). Then group the values of k by how many 7s they contribute — the count is constant on each block of 7 consecutive values.
Show solution
Approach: Legendre's 7-count, summed over every factorial in blocks
- Across a product, exponents add, so the number of 7s in 1!·2!·…·51! is the sum of v₇(k!) for k = 1 to 51, where Legendre's formula gives v₇(k!) = ⌊k/7⌋ + ⌊k/49⌋.
- Track how the count grows as k rises. For k = 1–6 it's 0; then it steps up by 1 each time k passes a new multiple of 7, staying flat in between — so v₇(k!) = 1 for the 7 values 7–13, = 2 for 14–20, …, up to = 6 for 42–48.
- That block sums to 7×(1+2+3+4+5+6) = 7×21 = 147. Then at k = 49 the count jumps to 8 (= ⌊49/7⌋ + ⌊49/49⌋ = 7 + 1), and k = 49, 50, 51 each give 8, adding 3×8 = 24.
- Total = 147 + 24 = 171.
- Why this transfers: to count a prime p in a factorial, use ⌊k/p⌋ + ⌊k/p²⌋ + …; the higher powers (here 49 = 7²) are exactly what create the surprise ‘jump’ that an easy 1+2+3+… guess would miss.
Mark:
· log in to save