codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#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
Private
[
?
]
Run code
Submit