
18 Mar
2009
18 Mar
'09
2:43 p.m.
Daniel Fischer
Am Mittwoch, 18. Maerz 2009 16:14 schrieb Will Ness:
sum $ take m $ cycle [1..k] | n > 0 = x*n+y where (n,r) = quotRem m k x = sum [1..k] y = sum [1..r]
In fact, the super-brilliant deducting compiler would make it sum $ take m $ cycle [1..k] | n > 0 = x*n+y where (n,r) = quotRem m k x = k*(k+1)/2 y = r*(r+1)/2 :) :) Now THAT would be a deductive power to behold!