For each positive integer , let denote the greatest prime factor of . For how many positive integers is it true that both and ?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
The largest prime factor equals the square root only for a prime squared. So look for two prime squares 48 apart: 121 and 169.
Solution
First decode the strange condition .
1. What does the condition mean? is a prime, so must be a prime , and then . And for the only prime factor is , so the condition holds. For example, , but while . So the condition just says: is the square of a prime.
2. Restate the problem. We need primes and with and . So
3. Factor. , so must be split as (small factor) (big factor) with small and big .
4. Both factors are even. The two factors differ by , which is even, so they are both even or both odd. Their product is even, so both are even. The even pairs for are , , .
5. Solve each pair. is half the sum and is half the difference:
| pair | both prime? | ||
|---|---|---|---|
| yes | |||
| no | |||
| no |
- Answer. Only works, and .
The answer is .
Why this works
The fancy notation hides a simple idea: "largest prime factor equals the square root" means "square of a prime." Two squares with a fixed difference are handled by factoring the difference of squares, and the both-even rule cuts the list of factor pairs down to three.
Alternative approach
Check small primes. If are primes, the gap grows as the primes grow. For odd , the next possible prime is at least , and . That is more than once is bigger than . So test only : adding to gives . Only is a prime squared.
The trap
Counting pairs of squares that differ by 48 without checking that both roots are prime, for example 1 and 49, or 16 and 64.
Concise solution
Decode the condition. If , then is an integer and is prime, say , so . Conversely . Thus the condition says exactly that is the square of a prime.
So we need primes with and , i.e.
The factors and differ by , an even number, so they have the same parity; since their product is even, both are even. The factor pairs of with both entries even are , , . Solving , :
- : , , both prime.
- : , not prime.
- : , , not prime.
Only works (and indeed ).
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 2: Primes and Composites
- Introduction to Number Theory, Chapter 7: Algebra With Integers
- Introduction to Algebra, Chapter 11: Special Factorizations
- Introduction to Number Theory, Chapter 4: Prime Factorization (§4.2, §4.4)
Techniques
Apply an identity: SFFT, sum of squares, difference of cubes, Vieta · Use an invariant, parity, or coloring argument