import math r=range(-50,52) p=[0]*500 for x in r: for y in r: for z in r:p[math.ceil((x*x+y*y+z*z)**.5)]+=1 a=0 for x in p[:51]:a+=x;print(a)