Decompose integer into sum of squares by sugyan

use List::Util 'sum';$c[sum map{$_**2}@$_]||=[grep$_,@$_]for map{@a=@$_;map[$_,@a],1..17}map{@a=@$_;map[$_,@a],0..12}map{@a=$_;map[$_,@a],0..8}0..2;print"$_: @{$c[$_]}\n"for 1..300

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

download

return to the top page