So I'm trying to solve problem 5 (Project Euler), and I'm not sure if I have implemented the code incorrectly somehow, or if the number is just so high that I cannot reach it before I close the program (I did wait a fair amount of time, going into the 10's of thousands), and so I am asking here. Of course, there is likely a much better way to do it, but this is what I came up with first:

Mekire: Removed to avoid spoiling for others.

I used an infinite loop on the outside because I think that is the only way to "restart" the for loop, i.e. have it set value to be 1 again, so that it tests from 1 upwards for a new number, not from 5 upwards (for example). It never prints a number, however, so I wanted to ask if it's because my program is faulty in some way or whether the number is just too high for it to be reached before I stop the shell from running.

Oh, the question is "what is the smallest positive number that is *evenly* divisible by all the numbers from 1-20.". I started with the number '2520' because that is the smallest number divisible by all numbers from 1-10 (therefore, no number smaller than it could possibly be correct for 1-20).

EDIT: I left the program running for 5 minutes or so and got the result: Answer removed (Project Euler says I'm correct). So I guess now I can just use this thread for help as to how to 'improve' the solution, such as making it faster or less resource intensive (for example)?