Question 79
Determine the number of pairs $(p, a)$ of a prime number $p$ and an integer $a$ such that $p \ge 3$, $1 \le a \le 2024$, and the following condition is satisfied:
$a \lt p^4$ holds and $ap^4 + 2p^3 + 2p^2 + 1$ is a square number.
$a \lt p^4$ holds and $ap^4 + 2p^3 + 2p^2 + 1$ is a square number.