First find all 2-digit natural numbers n such that n2 ends in the same 2 digits as n. Then use the fact that a 4-digit number whose square ends in the same 4 digits must end in one of these 2-digit numbers. Similarly, an 8-digit number with this property must end in one of these 4-digit numbers.