PTCLONG - Pythagorean Triple Counting (LTL)
There are already some SPOJ problems related to Pythagorean triples. Here is another one: Given an integer n, calculate the number p(n) of Pythagorean triples with at least one cathetus of length n.
Input starts with a positive integer t≤1000, the number of testcases.
Each of the following t lines contains a positive integer n≤1015.
For every n print the value of p(n) in a single line.
Input: 3 4 5 6 Output: 1 1 1
Explanation: The only Pythagorean triple that has a cathetus with length 4 is (3,4,5), so p(4)=1.