AMC 10 Step by Step

2019 AMC 10A Problem 25

P21-25~10 minPrint

For how many integers nn between 11 and 5050 , inclusive, is (n2−1)!(n!)n\frac{(n^2-1)!}{(n!)^{n}} an integer? (Recall that 0!=10!=1 .)

Log in to save your progress.
Show solution without answering

Key insight

Counting ways to split n squared people into n teams shows the fraction is a whole number times (n-1)!/n. Only primes and n = 4 fail.

Solution

Step 1: try small cases.

  • n=1n = 1: 0!1!=1\frac{0!}{1!} = 1. Whole number.
  • n=2n = 2: 3!(2!)2=64\frac{3!}{(2!)^2} = \frac{6}{4}. Not whole.
  • n=3n = 3: 8!(3!)3=40320216=186.67…\frac{8!}{(3!)^3} = \frac{40320}{216} = 186.67\ldots. Not whole.
  • n=4n = 4: 15!(4!)4\frac{15!}{(4!)^4}. We will see below that this is not whole.

So some values fail. We need a way to sort all 5050.

Step 2: a counting fact. Split n2n^2 people into nn teams of nn people each, where the teams have no names (only who is with whom matters). The number of ways is
K=(n2)!(n!)n⋅n!.K = \frac{(n^2)!}{(n!)^n \cdot n!}.
(Line everyone up in (n2)!(n^2)! ways and cut into blocks of nn; each team's order inside does not matter, divide by n!n! for each of the nn teams; the order of the teams does not matter, divide by another n!n!.) Since KK counts something, it is a whole number.

Step 3: rewrite the fraction using KK. Since (n2)!=n2⋅(n2−1)!(n^2)! = n^2 \cdot (n^2 - 1)!,
(n2−1)!(n!)n=(n2)!(n!)n⋅n2=K⋅n!n2=K⋅(n−1)!n.\frac{(n^2-1)!}{(n!)^n} = \frac{(n^2)!}{(n!)^n \cdot n^2} = K \cdot \frac{n!}{n^2} = K \cdot \frac{(n-1)!}{n}.
So the fraction is surely a whole number whenever nn divides (n−1)!=1⋅2⋯(n−1)(n-1)! = 1 \cdot 2 \cdots (n-1).

Step 4: nn not prime and at least 6 always works.

  • If n=a⋅bn = a \cdot b with aa and bb different and both smaller than nn (like 12=3⋅412 = 3 \cdot 4), then both aa and bb appear in 1⋅2⋯(n−1)1 \cdot 2 \cdots (n-1), so nn divides it.
  • If nn is a prime pp squared with pp at least 33, like 9=3⋅39 = 3 \cdot 3 or 25=5⋅525 = 5 \cdot 5, then pp and 2p2p both appear below nn (for 99: 33 and 66), giving at least two factors of pp.

Step 5: primes always fail. Take n=pn = p prime. The bottom (p!)p(p!)^p has pp factors of pp (one from each p!p!). The top (p2−1)!(p^2 - 1)! gets a factor of pp only from the multiples p,2p,…,(p−1)pp, 2p, \ldots, (p-1)p, which is just p−1p - 1 factors. There are more pp's on the bottom than on the top, so it is not whole.

Step 6: n=4n = 4 fails. The bottom (4!)4=244(4!)^4 = 24^4 has 3⋅4=123 \cdot 4 = 12 factors of 22. In the top, 15!15!: the even numbers up to 1515 give 77 factors of 22, the multiples of 44 give 33 more, and 88 gives 11 more, for 1111 in all. 11<1211 < 12, so it is not whole.

Step 7: count. The primes up to 5050 are 2,3,5,7,11,13,17,19,23,29,31,37,41,43,472, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47: fifteen of them. Adding n=4n = 4 gives 1616 failures. Every other nn (including 11) works, so the count is 50−16=3450 - 16 = 34.

The answer is (D) 34\boxed{\textbf{(D)}\ 34}.

Why this works

A fraction that counts something must be a whole number, which is a quick way to prove many cases at once. For the cases that fail, count how many times a prime appears on top and on bottom. The leftover question "does nn divide (n−1)!(n-1)!?" has a well-known answer: yes for every non-prime nn except 44, which is exactly the surprise value here.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

Rewrite using (n2)!=n2⋅(n2−1)!(n^2)! = n^2 \cdot (n^2 - 1)!:
(n2−1)!(n!)n=(n2)!(n!)n⋅n2.\frac{(n^2-1)!}{(n!)^n} = \frac{(n^2)!}{(n!)^n \cdot n^2}.
The number of ways to split n2n^2 labeled objects into nn unlabeled groups of nn is (n2)!(n!)n⋅n!\frac{(n^2)!}{(n!)^n \cdot n!}, an integer KK. Hence
(n2−1)!(n!)n=K⋅n!n2=K⋅(n−1)!n.\frac{(n^2-1)!}{(n!)^n} = K \cdot \frac{n!}{n^2} = K \cdot \frac{(n-1)!}{n}.
So the expression is certainly an integer whenever n∣(n−1)!n \mid (n-1)!.

Composite n≥6n \ge 6: write n=abn = ab with 1<a<b<n1 < a < b < n, so aa and bb are distinct factors of (n−1)!(n-1)!; if n=p2n = p^2 with p≥3p \ge 3, then pp and 2p2p both lie below nn. Either way n∣(n−1)!n \mid (n-1)!, and the expression is an integer. Also n=1n = 1 gives 0!1=1\frac{0!}{1} = 1.

Prime n=pn = p: the exponent of pp in (p2−1)!(p^2 - 1)! is ⌊(p2−1)/p⌋=p−1\lfloor (p^2-1)/p \rfloor = p - 1, while (p!)p(p!)^p contains ppp^p. Not an integer.

n=4n = 4: the denominator (4!)4=244(4!)^4 = 24^4 has 2122^{12}, but 15!15! has only 7+3+1=117 + 3 + 1 = 11 factors of 22. Not an integer.

Failures: the 1515 primes up to 5050 plus n=4n = 4, so 1616 values fail and 50−16=3450 - 16 = 34 work.

The answer is (D) 34\boxed{\textbf{(D)}\ 34}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.