For how many positive integers less than or equal to is evenly divisible by
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
After simplifying, the question is whether n + 1 divides 2 times (n - 1) factorial. This fails only when n + 1 is an odd prime: 8 times.
Solution
1. Simplify the sum. . For example, .
2. Simplify the division. We want
Since , the cancels, leaving . So the question is: does divide ?
3. Try small cases to see a pattern:
| Divides? | |||
|---|---|---|---|
| 1 | 2 | 2 | yes |
| 2 | 3 | 2 | no |
| 3 | 4 | 4 | yes |
| 4 | 5 | 12 | no |
| 5 | 6 | 48 | yes |
| 6 | 7 | 240 | no |
| 8 | 9 | 10080 | yes |
The failures happen when is an odd prime.
4. Why a prime fails. Say is an odd prime such as . Then is , all smaller than . A prime cannot be built from smaller factors, so does not divide .
5. Why everything else works. If is not prime, split it into two smaller factors, like . Both factors are at most , so both appear in , and their product divides it. If the two factors are the same, as in , use and instead, both in . The only tiny cases, and , were checked in the table.
6. Count. runs from to . The odd primes in that range are : eight of them. So values of fail and work.
The answer is .
Why this works
Simplify the condition with algebra before testing numbers: here the cancels and a cleaner question appears. A factorial contains every number smaller than it, so any number built from smaller factors divides it. Primes are the only numbers that cannot be built that way, so they are the only ones that fail. Counting the few failures is easier than counting the successes.
The trap
Counting n + 1 = 2 as a failure (it works because of the extra factor 2), or wrongly thinking that n + 1 = 4 or n + 1 = 9 fail.
Concise solution
Since , the quotient is
So we need to divide .
If is an odd prime : divides neither nor any factor of , so the quotient is not an integer. These fail.
Otherwise: if (), the quotient is . If , the quotient is . If is composite and at least , write with ; if both appear as separate factors in , and if with then and both lie in . Either way divides . These succeed.
The odd primes up to are : eight values of , hence eight failing . The count of successes is .
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 1: Integers: The Basics (§1.4, §1.5)
- Introduction to Number Theory, Chapter 2: Primes and Composites
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.3)
- Introduction to Algebra, Chapter 11: Special Factorizations
Techniques
Apply an identity: SFFT, sum of squares, difference of cubes, Vieta · Count the complement and subtract from the total