- Code: Select all
: pe001(n) -- n1 : Returns sum of all multiples of 3 or 5 below n
| i |
0 n 1- loop: i [ i 3 mod i 5 mod and ifFalse: [ i + ] ] ;
: pe001(n) -- n1 : Returns sum of all multiples of 3 or 5 below n
| i |
0 n 1- loop: i [ i 3 mod i 5 mod and ifFalse: [ i + ] ] ;
Return to Project Euler in Oforth
Users browsing this forum: No registered users and 1 guest