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 (n2−1)!(n!)n \dfrac{(n^2 - 1)!}{(n!)^n} an integer? (Recall that 0!=1.0! = 1.)

Answer choices

Show solution

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.
AoPS wiki

Tagged: Legendre’s Formula · prime · digits

More practice