Skip to main content

2019 AMC 12A Problem 24

Problem 24 of 25HarderNumber Theory

For how many integers nn between 11 and 50,50, inclusive, is (n21)!(n!)n \dfrac{(n^2 - 1)!}{(n!)^n} an integer? (Recall that 0!=1.0! = 1.)

Answer choices

Show solution

Solution

Fix a prime pn.p\le n. By Legendre’s formula, the difference between the exponent of pp in the numerator and its exponent in the denominator is Dp=k1n21pknk1npk. \begin{aligned} D_p &=\sum_{k\ge1}\left\lfloor\dfrac{n^2-1}{p^k}\right\rfloor\\ &\quad-n\sum_{k\ge1}\left\lfloor\dfrac{n}{p^k}\right\rfloor. \end{aligned} If rkr_k is the remainder of nn modulo pk,p^k, the kkth summand is nrk1pk.\left\lfloor\dfrac{nr_k-1}{p^k}\right\rfloor. Let a=vp(n).a=v_p(n). The first aa summands are 1.-1. If nn is not a power of p,p, write n=pamn=p^a m with m2.m\ge2. When a1,a\ge1, the next summand is at least np1a,\dfrac{n}{p}-1\ge a, and all later summands are nonnegative; when a=0,a=0, every summand is already nonnegative. Thus Dp0D_p\ge0 unless nn is a power of p.p. For n=pa,n=p^a, Legendre’s formula reduces the requirement to pa12a(p1).p^a-1\ge2a(p-1). Among prime powers at most 50,50, this fails exactly when a=1a=1 (so nn is prime) and when n=22=4.n=2^2=4. There are 1515 primes at most 50,50, plus n=4,n=4, giving 1616 failures. Hence 5016=3450 - 16 = 34 values of nn work. Thus, the correct answer is D.

More practice

Concepts: Legendre’s Formula · prime · digits

Problem text and solution from the LIVE past-contest archive. See also the AoPS wiki page for community solutions.