Goldbach partition by 51b

-module(g).
-export([m/0]).
m()->F={io,format},L={lists,seq},[F("~p:",[N])>[F(" ~p+~p",[M,N-M])||M<-L(3,N div 2),f(M,2)>0,f(N-M,2)>0]++F("
")||N<-L(6,300,2)].
f(N,N)->1;f(N,M)->N rem M*f(N,M+1).

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

download

return to the top page