in the second example, just by finding n2=9, we can conclude that n=3. so why did we have to find n3=27?
From the first equation, we have n2 = 9,
since it is given that n is an integer, so from the above equation we get two values of n as +3 and -3
but it is from the second equation that is n3 = 27, we can have the conclusion that we have to take n = 3. The given conditions are satisfied for n = 3