Olympiad Maths Prep

Track / Stage 7 / 129 of 300 #1529 of 2000

Problem 1529

National olympiad second round; IMO P1/P4
Number theory Difficulty 7.2 Prove it

Show that [list=a][*] infinitely many perfect squares are a sum of a perfect square and a prime number, [*] infinitely many perfect squares are not a sum of a perfect square and a prime number. [/list]

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

1. Infinitely many perfect squares are a sum of a perfect square and a prime number:

Consider the perfect square (n+1)2(n+1)^2. We can express this as:
(n+1)2=n2+2n+1 (n+1)^2 = n^2 + 2n + 1
Here, n2n^2 is a perfect square and 2n+12n + 1 is an odd number. Since there are infinitely many odd prime numbers, we can choose nn such that 2n+12n + 1 is a prime number. For example, if n=1n = 1, 2n+1=32n + 1 = 3 (which is prime), and (1+1)2=4=12+3(1+1)^2 = 4 = 1^2 + 3. Similarly, for n=2n = 2, 2n+1=52n + 1 = 5 (which is prime), and (2+1)2=9=4+5(2+1)^2 = 9 = 4 + 5.

Since there are infinitely many odd primes, we can always find an nn such that 2n+12n + 1 is a prime number. Therefore, there are infinitely many perfect squares that can be expressed as the sum of a perfect square and a prime number.

2. Infinitely many perfect squares are not a sum of a perfect square and a prime number:

Consider the perfect square (n+1)2(n+1)^2 again. We can express this as:
(n+1)2=n2+2n+1 (n+1)^2 = n^2 + 2n + 1
Here, n2n^2 is a perfect square and 2n+12n + 1 is an odd number. Since there are infinitely many odd composite numbers, we can choose nn such that 2n+12n + 1 is an odd composite number. For example, if n=4n = 4, 2n+1=92n + 1 = 9 (which is composite), and (4+1)2=25=16+9(4+1)^2 = 25 = 16 + 9. Similarly, for n=6n = 6, 2n+1=132n + 1 = 13 (which is prime), and (6+1)2=49=36+13(6+1)^2 = 49 = 36 + 13.

Since there are infinitely many odd composite numbers, we can always find an nn such that 2n+12n + 1 is an odd composite number. Therefore, there are infinitely many perfect squares that cannot be expressed as the sum of a perfect square and a prime number.

To further solidify this, consider the expression (n+1)2a2=(n+a+1)(na+1)(n+1)^2 - a^2 = (n+a+1)(n-a+1). For all aa with a<na < n, if (n+a+1)(na+1)(n+a+1)(n-a+1) is an odd composite number, then (n+1)2(n+1)^2 cannot be expressed as the sum of a perfect square and a prime number.

This completes the proof for both parts.

\blacksquare

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.