Decompose integer into sum of squares by nn

f={n,i->for(;d&&!r&&(v=n-++i*i)>=0;v?d++:(r+=' '+i))--d>f(v,0)}
for(d=n=0;n<300;d++){r=''
f(n+1,0)
r&&println(++n+':'+r)}

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

download

return to the top page