Each of x, y and z is a positive integer satisfying:
x2+y2+z2 = 2014
How many solutions are there? For which triplets is x+y+z a perfect square? How many distinct values can x+y+z have?
*** Disregard permutations. For example, (p,q,r) and (p,r,q) should be treated as the same solution.