The squares form an increasing sequence. This means you can use binary search.
Start with and . Compute and check . If , you found it. If , search the right half. If , search the left half.
Watch out for overflow when computing . If is large, the product might exceed integer limits.