[ create a new paste ] login | about

tenten321

Name:
Email:
Site/Blog:
Location:
Default language: Python
Favorite languages:
About: Working on Project Euler problems.

Saved pastes by tenten321:

Python, pasted on Dec 2:
1
2
3
4
5
#Project Euler 7:
#What is the 10,001st prime number?

#Runtime, iteration setup:
import time
...
view (36 lines, 1 line of output)
Python, pasted on Jan 10:
1
2
3
4
5
#PE Problem 7 (non-simplified)
import time
start = time.time()
from math import log
iterations = 0
...
view (26 lines, 104 lines of output)
Python, pasted on Jan 3:
1
2
3
4
5
#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)
Python, pasted on Jan 1:
1
2
3
4
5
#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)
Python, pasted on Dec 30:
1
2
3
4
5
#Project Euler Problem 4

import time
start = time.time()
global bigO 
...
view (39 lines, 3 lines of output, 1 comment)
Python, pasted on Dec 22:
1
2
3
4
5
n=999*999
pal=0

def is_pal(n):
  nlist = list(str(n))
...
view (19 lines, 1 line of output)
Python, pasted on Dec 22:
1
2
3
4
5
#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)
Python, pasted on Dec 10:
1
2
3
4
#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)
Python, pasted on Dec 10:
1
2
3
4
5
naturals = range(1,1000)

total = 0

for n in naturals:
...
view (10 lines, 1 line of output)
Python, pasted on Nov 18:
1
2
3
4
5
from math import sqrt

n=135066410865995223349603216278805969938881475605667027524485143851526510604859533833940287150571909441798207282164471551373680419703964191743046496589274256239341020864383202110372958725762358509643110564073501508187510676594629205563685529475213500852879416377328533906109750544334999811150056977236890927563

print "%.10e"  %  (sqrt(n)/2)
view (5 lines, 1 line of output)