- 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 + ] ] ;

1 post
• Page **1** of **1**

Problem 1 : Find the sum of all the multiples of 3 or 5 below 1000.

- 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 + ] ] ;

- Franck
**Posts:**144**Joined:**29 Oct 2014 19:01

1 post
• Page **1** of **1**

Return to Project Euler in Oforth

Users browsing this forum: No registered users and 1 guest