Let the two numbers be x and x + 5.
From the given information,
x2 + (x + 5)2 = 97
2x2 + 10x + 25 − 97 = 0
2x2 + 10x − 72 = 0
x2 + 5x − 36 = 0
(x + 9) (x − 4) = 0
x = − 9 or 4
Since, − 9 is not a natural number. So, x = 4.
Thus, the numbers are 4 and 9.