Smallest multiple: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
;Task: |
;Task: |
||
Task desciption is taken from |
Task desciption is taken from |
||
<br>https://projecteuler.net/problem=5 |
<br>(https://projecteuler.net/problem=5) |
||
<br>2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. |
<br>2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. |
||
<br>What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |
<br>What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |
Revision as of 05:53, 21 October 2021
Smallest multiple is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
- Task
Task desciption is taken from
(https://projecteuler.net/problem=5)
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
Ring
<lang ring> see "working..." + nl see "Smallest multiple is:" + nl n = 0
while true
n++ flag = 0 for m = 1 to 20 if n % m = 0 flag += 1 ok next if flag = 20 see "" + n + nl exit ok
end
see "done..." + nl </lang>
- Output:
working... Smallest multiple is: 232792560 done...