count lattice2 by rolf

r=lambda(x):range(-x,x+1) 
for n in range(51):print sum(x*x+y*y+z*z<=n*n for x in r(n)for y in r(int((n*n-x*x)**.5))for z in r(int((n*n-x*x-y*y)**.5)))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page