```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ``` ```#Project Euler 5: #What is the smallest number divisible by each of the numbers 1 to 20 (or n)? #Runtime, iteration setup: import time start = time.time() global bigO bigO = 0 #Init: n=20 primes=[] #First, find the primes between 1 and n: for i in range(2,n+1): print "i ",i for p in primes: print "p ",p if i%p == 0: print i, " is not prime." break primes.append(i) print primes print primes ```
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 ``` ```i 2 [2] i 3 p 2 [2, 3] i 4 p 2 4 is not prime. [2, 3, 4] i 5 p 2 p 3 p 4 [2, 3, 4, 5] i 6 p 2 6 is not prime. [2, 3, 4, 5, 6] i 7 p 2 p 3 p 4 p 5 p 6 [2, 3, 4, 5, 6, 7] i 8 p 2 8 is not prime. [2, 3, 4, 5, 6, 7, 8] i 9 p 2 p 3 9 is not prime. [2, 3, 4, 5, 6, 7, 8, 9] i 10 p 2 10 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10] i 11 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] i 12 p 2 12 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] i 13 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 p 11 p 12 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] i 14 p 2 14 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] i 15 p 2 p 3 15 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] i 16 p 2 16 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] i 17 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 p 11 p 12 p 13 p 14 p 15 p 16 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] i 18 p 2 18 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] i 19 p 2 p 3 p 4 p 5 p 6 p 7 p 8 p 9 p 10 p 11 p 12 p 13 p 14 p 15 p 16 p 17 p 18 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] i 20 p 2 20 is not prime. [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] ```