aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/euler/006.bruijn
blob: 4de0d104c3236629e912bb4949a0804fdae5fbc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
:import std/Combinator .
:import std/Math .

solve [square-of-sum - sum-of-squares]
	sum-of-squares ∑ (+1) → 0 | (\pow (+2))
	square-of-sum (∑ (+1) → 0 | i) ** (+2)

:test ((solve (+10)) =? (+2640)) ([[1]])

main [solve (+100)]