Find all natural integers $n$ such that $(n^3 + 39n - 2)n! + 17\cdot 21^n + 5$ is a square.
Problem
Source: Macedonia National Olympiad 2017
Tags: number theory, algebra
09.04.2017 00:16
For $n = 1$ we have $$(n^{3} + 39n - 2)n! + 17 \cdot 21^{n} + 5 = 20^{2}$$ If $n = 2$ we get $4| (n^{3} +39n - 2)n!$ so we get that $(n^{3} +39n - 2)n! + 17 \cdot 21^{n} + 5 \equiv 2 \; mod \; 4$ which is not a quadratic residue mod $4$. If $n \ge 3$ we get that $3|n!$ and $(n^{3} +39n - 2)n! + 17 \cdot 21^{n} + 5 \equiv 2 \; mod \; 3$ which is also not a quadratic residue mod $3$. The only solution is $n = 1$.
09.04.2017 01:27
let $f(n)=(n^3+39n-2)n!+17.21^n+5$ if $n\geq5$, we have$ f(n)=2[5]$ which is impossible since a square is $0,-1,1 mod(5)$ thus $n<5$ working cases we get $n=1$ the only solution.
26.04.2023 19:10
Posting for storage Notice that for $n\ge 3$ we have that: $(n^3 + 39n - 2)n! + 17\cdot 21^n + 5 \equiv 2\pmod 3$ however this is a contradiction since $k^2 \equiv 0,1 \pmod 3$ Thus $n\le 2$, a quick manual check shows that $\boxed{n=1}$ is the only solution. QED