2019 AMC 12A Problem 24

Attempt Problem 24 of the 2019 AMC 12A below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2019 AMC 12A solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

24.

For how many integers nn between 11 and 50,50, inclusive, is (n2−1)!(n!)n \dfrac{(n^2 - 1)!}{(n!)^n} an integer? (Recall that 0!=1.0! = 1.)
3131
3232
3333
3434
3535
Answer: D
Concepts:Legendre’s Formulaprimedigits
Small hint:
Compare the exponent of a prime pp in numerator and denominator using vp(m!)=m−sp(m)p−1v_p(m!) = \dfrac{m - s_p(m)}{p - 1}
Big hint:
Failure requires nn to be a prime power pap^a with pa−1<2a(p−1)p^a - 1 \lt 2a(p - 1)
Solution:
Fix a prime p≤n.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=∑k≥1⌊n2−1pk⌋−n∑k≥1⌊npk⌋. \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 ⌊nrk−1pk⌋.\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 m≥2.m\ge2. When a≥1,a\ge1, the next summand is at least np−1≥a,\dfrac{n}{p}-1\ge a, and all later summands are nonnegative; when a=0,a=0, every summand is already nonnegative. Thus Dp≥0D_p\ge0 unless nn is a power of p.p.
For n=pa,n=p^a, Legendre’s formula reduces the requirement to pa−1≥2a(p−1).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 50−16=3450 - 16 = 34 values of nn work.
Thus, the correct answer is D.
LIVE by Po-Shen Loh
Programs

LIVE Classes

Self-Paced Classes

Stars

Scholarship

About Us

Who Is Po-Shen Loh?

Email Contact

Newsletter

Jobs

Become a Star

For a more Thought Full world.

© 2026 Expii, Inc.