WC 7.2 Find squares

Find the number of distinct integer solutions for the equation: x2 + y2 = n

An integer solution is the pair (x, y) such that both are integers which satisfy the above equation.
Two integer solutions (x1, y1), (x2, y2) are different from each other if x1 = x2 and y1 = y2 is not true simultaneously.

Give your answer as sum of answers for the following 'n' :
9, 567890000, 10000000000, 999999999, 123454321, 10000000000000

Examples:

For n = 4 ans = 4
Valid solutions : (0, 2) (2, 0) (0, -2) (-2, 0)

For n = 5 ans = 8

This challenge is worth 80 points.

You must be logged in to submit a solution

View ranklist for this challenge
About scoring and submission

Contact Us


Krish Shah : 9323115454

Kaustubh Khavnekar : 9769408039



Privacy Policy