Maths Olympiad Prep

Library / Macedonian Mathematical Olympiad /7 of 23

Macedonian Mathematical Olympiad

Number theory Difficulty 5.7 AIME, harder Prove it North Macedonia

Determine all positive integers nn such that (n3+39n−2)n+17−21n+5(n^3+39n-2)n+17-21^n+5 is a full square.

Solution

Let us denote an=(n3+39n−2)n+17−21n+5a_n = (n^3+39n-2)n+17-21^n+5.

If n≥4n \ge 4, then 8∣n!8 \mid n!. Moreover,
an≡5n+5(mod8). a_n \equiv 5^n + 5 \pmod{8}.
If nn is an even number, then 5n≡1(mod8)5^n \equiv 1 \pmod{8}, so an≡6(mod8)a_n \equiv 6 \pmod{8}. But, all full squares have remainder 0,10,1 or 44 when divided by 88. So, if n≥4n \ge 4 and nn is even, then ana_n is not a full square.

Let n≥7n \ge 7. It is clear that 7∣n!7 \mid n!. Then an≡5(mod7)a_n \equiv 5 \pmod{7}. On the other side, the remainders of the full squares when divided by 77 are 0,1,20,1,2 or 44. So, ana_n is not a full square for n≥7n \ge 7. Having in mind the previous discussion, it remains to check for n=1,n=2,n=3n=1, n=2, n=3 and n=5n=5.

If n=5n=5, a5≡2⋅15+5≡2(mod8)a_5 \equiv 2 \cdot 1^5 + 5 \equiv 2 \pmod{8}.
Since the remainders of a full square when divided by 55 are 0,10,1 or 44, a5a_5 is not a full square.

For n=3n=3, we have a3≡3(mod7)a_3 \equiv 3 \pmod{7}, so a3a_3 is not a full square.

For n=2n=2, we have a2≡1+5≡2(mod4)a_2 \equiv 1+5 \equiv 2 \pmod{4}, so a2a_2 is not a full square.

For n=1n=1, a1=(1+39−2)⋅1+17⋅2+5=400a_1 = (1+39-2) \cdot 1 + 17 \cdot 2 + 5 = 400.

This means that only for n=1n=1, ana_n is a full square.

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

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