Maths Olympiad Prep

Library / /1373 of 1394

, 2022

Number theory Difficulty 6.3 National Olympiad Prove it United States

Problem:

Compute the smallest positive integer nn for which there are at least two odd primes pp such that
k=1n(1)νp(k!)<0 \sum_{k=1}^{n}(-1)^{\nu_{p}(k!)}<0
Note: for a prime pp and a positive integer mm, νp(m)\nu_{p}(m) is the exponent of the largest power of pp that divides mm; for example, ν3(18)=2\nu_{3}(18)=2.
Proposed by: Krit Boonsiriseth

Solution

Solution:

Say nn is pp-good if k=1n(1)νp(k!)<0\sum_{k=1}^{n}(-1)^{\nu_{p}(k!)}<0, where pp is an odd prime.

Claim. nn is pp-good iff
n+1=i=0kaip2i+1 n+1=\sum_{i=0}^{k} a_{i} p^{2 i+1}
where aia_{i} is an even integer with ai<p\left|a_{i}\right|<p.

The proof of this claim will be deferred to the end of the solution as it is rather technical, and we believe that it would be more illuminating for the reader to graph the function nk=1n(1)νp(k!)n \mapsto \sum_{k=1}^{n}(-1)^{\nu_{p}(k!)} and examine its properties, instead of focusing on the formal proof.

A consequence of the claim is that if nn is pp-good then pp divides n+1n+1, and p2k1<n+1<p2kp^{2 k-1}<n+1<p^{2 k} for some kZ+k \in \mathbb{Z}^{+}.

Now suppose nn is pp-good and qq-good for distinct odd primes p<qp<q. Then n+1pq>p2n+1 \geq p q>p^{2}, so we must have n+1>p3n+1>p^{3}.

Checking p=3p=3, the smallest potential n+1n+1 's are
- 23323=482 \cdot 3^{3}-2 \cdot 3=48, which does not have a prime factor q>3q>3.
- 233=542 \cdot 3^{3}=54, which does not have a prime factor q>3q>3.
- 233+23=602 \cdot 3^{3}+2 \cdot 3=60, which does not work because 60 is the wrong size for q=5q=5.
The next value 235233232 \cdot 3^{5}-2 \cdot 3^{3}-2 \cdot 3 is already bigger than 230.

Checking p=5p=5, the smallest potential n+1n+1 's are
- 25345=2302 \cdot 5^{3}-4 \cdot 5=230, which works for q=23q=23.

For p7,n+1p3>230p \geq 7, n+1 \geq p^{3}>230, so 229 is the smallest value of nn.

It suffices to prove the claim. We argue via a series of lemmas. We introduce the notation of S(a,b)=k=ab1(1)νp(k!)S(a, b)=\sum_{k=a}^{b-1}(-1)^{\nu_{p}(k!)}. Note that nn is pp-good if and only if S(0,n+1)0S(0, n+1) \leq 0.

Lemma 1. If np2,S(0,n)n \leq p^{2}, S(0, n) is the distance to the nearest even multiple of pp.

Proof. This follows straightforwardly from the fact that νp(k!)=k/p\nu_{p}(k!)=\lfloor k / p\rfloor for np2n \leq p^{2}.

Lemma 2. If aa and bb are positive integers so that bpνp(a)b \leq p^{\nu_{p}(a)}, then S(a,a+b)=(1)νp(a!)S(0,b)S(a, a+b)=(-1)^{\nu_{p}(a!)} S(0, b).

Proof. Note that for 0<k<b,νp(a+k)=νp(k)0<k<b, \nu_{p}(a+k)=\nu_{p}(k), so it follows that νp((a+k)!)=νp(a!)+νp(k!)\nu_{p}((a+k)!)=\nu_{p}(a!)+\nu_{p}(k!). The result follows.

Lemma 3. For any nonnegative integer a,νp((ap2)!)a, \nu_{p}\left(\left(a p^{2}\right)!\right) is the same parity as νp(a!)\nu_{p}(a!).

Proof. Note that νp((ap2)!)νp(a!)=ap+a=a(p+1)\nu_{p}\left(\left(a p^{2}\right)!\right)-\nu_{p}(a!)=a p+a=a(p+1), which is even as pp is odd.

Lemma 4. For a nonnegative integer a,S(ap2,(a+1)p2)=p(1)νp(a!)a, S\left(a p^{2},(a+1) p^{2}\right)=p(-1)^{\nu_{p}(a!)}.

Proof. Combine Lemmas 1, 2, and 3.

Lemma 5. For a nonnegative integer a,S(0,ap2)=pS(0,a)a, S\left(0, a p^{2}\right)=p S(0, a).

Proof. Apply Lemma 4 and sum.

Lemma 6. If a,ba, b are nonnegative integers with b<p2b<p^{2}, then S(0,ap2+b)=pS(0,a)+(1)νp(a!)S(0,b)S\left(0, a p^{2}+b\right)=p S(0, a)+(-1)^{\nu_{p}(a!)} S(0, b).

Proof. Combine Lemmas 2, 3, and 5.

We are now ready to prove the claim. Call a nonnegative integer neat if it can be written as i=0kaip2i+1\sum_{i=0}^{k} a_{i} p^{2 i+1} for integers aia_{i} with ai<p\left|a_{i}\right|<p. For a nonnegative integer nn, let P(n)P(n) be the following statements:
- S(0,n)0S(0, n) \geq 0.
- S(0,n)=0S(0, n)=0 if and only if nn is neat. In this case, νp(n!)\nu_{p}(n!) is even.
- S(0,n)=1S(0, n)=1 if and only if n+1n+1 is neat or n1n-1 is neat. If n+1n+1 is neat, then νp(n!)\nu_{p}(n!) is odd. If n1n-1 is neat, then νp(n!)\nu_{p}(n!) is even.

It suffices to show P(n)P(n) for all nn, which we will prove by induction on nn. The base case of n=0n=0 is obvious.

Now take some n>0n>0 and suppose n=ap2+bn=a p^{2}+b for 0b<p20 \leq b<p^{2}. Lemma 6 tells us that S(0,n)=pS(0,a)+(1)νp(a)S(0,b)S(0, n)=p S(0, a)+(-1)^{\nu_{p}(a)} S(0, b). Since 0S(0,b)p0 \leq S(0, b) \leq p (by Lemma 1), the only way for S(0,n)S(0, n) to be less than 0 is if S(0,a)=0S(0, a)=0 and (1)νp(a)=1(-1)^{\nu_{p}(a)}=-1, which is impossible since P(a)P(a) holds.

There are two ways for S(0,n)=0S(0, n)=0 to be true. The first case is that S(0,a)=S(0,b)=0S(0, a)=S(0, b)=0, which implies by P(a)P(a) and Lemma 1 that aa is neat and bb is a multiple of 2p2 p. This captures the neat numbers with a00a_{0} \geq 0. Note that in this case νp(n!)=νp((ap2)!)+νp(b!)\nu_{p}(n!)=\nu_{p}\left(\left(a p^{2}\right)!\right)+\nu_{p}(b!) (by the same logic as Lemma 2), which is even as νp((ap2)!)\nu_{p}\left(\left(a p^{2}\right)!\right) is even by P(a)P(a) and Lemma 3 and νp(b!)=b/p\nu_{p}(b!)=b / p which is even.

The second way for S(0,n)S(0, n) to be 0 is if S(0,a)=1,S(0,b)=pS(0, a)=1, S(0, b)=p, and (1)νp(a!)=1(-1)^{\nu_{p}(a!)}=-1. By the inductive hypothesis, this is equivalent to a+1a+1 being neat and bb being an odd multiple of pp. This captures exactly the neat numbers with a0<0a_{0}<0. Also, νp(n!)=νp((ap2)!)+νp(b!)\nu_{p}(n!)=\nu_{p}\left(\left(a p^{2}\right)!\right)+\nu_{p}(b!), which is even as νp(a!)\nu_{p}(a!) is odd and νp(b!)\nu_{p}(b!) is odd.

Analyzing the possibilities where S(0,n)=1S(0, n)=1 is almost exactly the same as the above, so we will omit it here. We encourage the reader to fill in the details.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.