In: Advanced Math
How do I determine if a big number (6+ digits) is a perfect square or not?
Reduce it into its prime factors by trial division by the prime numbers up to its square root. If it is not divisible by any of these numbers then the number itself is prime and is not a square, stop right here.
If not, then look at the powers of the prime number factors of this number. If any of them are odd the number is not a perfect square. If they are all even, it is.
Example: 15876=22∗34∗72
All powers are even so this number is a perfect square.
Its root is the product of the primes above raised to half the above powers:
21∗32∗71=2∗9∗7=126
method is below.