Instantly share code, notes, and snippets.

What would you like to do?
A solution to Project Euler Problem 5 in Nim
var n: int = 20
var found: bool = false
while (not found):
for i in countdown(20, 1):
if (n mod i == 0):
if (i == 1):
found = true;
if (not found):
n += 20
echo "The smallest positive number that is evenly divisible by all numbers from 1 to 20 is ", n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment