project-euler-100

[RADIOACTIVE] solutions to the first 100 challenges of project euler
git clone git://git.figbert.com/project-euler-100.git
Log | Files | Refs | README

commit fa05097c70083a6a88df4a7eb72ffcd1e702f798
parent b7234294975065e7906701e869e70da13fdedc74
Author: therealFIGBERT <figbertwelner@gmail.com>
Date:   Thu, 23 Jan 2020 11:18:44 -0800

Add solution to problem 5

Diffstat:
Aproblem005.py | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/problem005.py b/problem005.py @@ -0,0 +1,14 @@ +# problemName = "Smallest multiple" +# problemNum = 5 +# solutionBy = "FIGBERT" +# language = "Python" +# dateCompleted = "21/01/2020" + +answer = 1 +for i in range(1, 21): + if answer % i > 0: + for k in range(1, 21): + if (answer * k) % i == 0: + answer *= k + break +print("The smallest positive number that is evenly divisible by all of the numbers from 1 to 20 is %s" % answer)