tenten321
|
codepad
|
|
tenten321
|
Saved pastes by tenten321:
#Project Euler 7:
#What is the 10,001st prime number?
#Runtime, iteration setup:
import time
|
view (36 lines, 1 line of output) |
#PE Problem 7 (non-simplified)
import time
start = time.time()
from math import log
iterations = 0
|
view (26 lines, 104 lines of output) |
#Project Euler 5:
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
#Runtime, iteration setup:
import time
|
view (39 lines, 4 lines of output, 1 comment) |
#Project Euler 5:
#What is the smallest number divisible by each of the numbers 1 to 20 (or n)?
#Runtime, iteration setup:
import time
|
view (27 lines, 124 lines of output) |
#Project Euler Problem 3:
#What is the largest prime factor of the number 600851475143 ?
import time
start = time.time()
|
view (42 lines, 5 lines of output, 1 comment) |
#Project Euler Problem 2:
#
#Find the sum of all the even-valued terms in the sequence
# which do not exceed four million.
|
view (30 lines, 3 lines of output, 1 comment) |
from math import sqrt
n=135066410865995223349603216278805969938881475605667027524485143851526510604859533833940287150571909441798207282164471551373680419703964191743046496589274256239341020864383202110372958725762358509643110564073501508187510676594629205563685529475213500852879416377328533906109750544334999811150056977236890927563
print "%.10e" % (sqrt(n)/2)
|
view (5 lines, 1 line of output) |