Mathematics
A Simple Number Theory Problem
Number Theory is one of the most important fields of Mathematics. In every Olympiad, you will see at least one Number Theory problem. One of the main things, studied in Number Theory, is prime numbers.
This problem isn’t hard, and make sure to try it for yourself before reading the solution.
Solution
We will use modular arithmetic. First, let’s see what we get modulo 3.
Thus we get
We know that a square of any number is congruent to either 0 or 1 modulo 3. Checking all four possible combinations, we conclude that
So, q is divisible by 3. But q is prime, so q must be equal to 3. Now, plugging in 3 for q we get the following equation
Now, let’s try modulo 5
We need to examine all possible remainders when a square and the fourth power of a number are divided by 5
Hence we get that this is only possible when
Therefore, p = 5 (because p is prime). Now it is left to do some trivial calculations
So, we get that the only solution to the original equation is
And we are done.