Decompose integer into sum of squares by xsd

let rec($)i m=let rec p?(g=Printf.printf)j a c m=j=0&print_newline(List.iter(g" %d")a)=g"%d:"i||m>0&(j>=c*c&p(j-c*c)(c::a)c(m-1)||c<j&p j a(c+1)m)in
i<301&(p i[]1m||i$m+1)&i+1$1;;1$1

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

download

return to the top page