To solve this problem, we need to determine the value of x, which represents the remainder when n^2 is divided by 5.
We know that n gives a remainder of 3 when divided by 5. This means n can be written as 5k + 3, where k is an integer.
Let's substitute this expression for n into the equations given:
(5k + 3)^2 gives a remainder of x when divided by 5.
(5k + 3)^3 gives a remainder of 2 when divided by 5.
To simplify, let's expand (5k + 3)^2 and (5k + 3)^3:
(5k + 3)^2 = 25k^2 + 30k + 9
(5k + 3)^3 = 125k^3 + 225k^2 + 135k + 27
Now, let's find the remainders when these expressions are divided by 5:
(25k^2 + 30k + 9) mod 5 = (25k^2 mod 5 + 30k mod 5 + 9 mod 5) mod 5
= (0 + 0 + 4) mod 5
= 4
(125k^3 + 225k^2 + 135k + 27) mod 5 = (125k^3 mod 5 + 225k^2 mod 5 + 135k mod 5 + 27 mod 5) mod 5
= (0 + 0 + 0 + 2) mod 5
= 2
We have found that the remainder when n^2 is divided by 5 is 4, and the remainder when n^3 is divided by 5 is 2.
Therefore, the value of unknown variable x is 4.
The answer is: 4
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
For a certain natural number $n$, $n^2$ gives a remainder of X when divided by 5, and $n^3$ gives a remainder of 2 when divided by 5. The remainder that $n$ gives when divided by 5 is 3. What is the value of unknown variable X?

### Answer:
