The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Python Code
Posted by: MrLOL | October 13, 2010 @ 2:19pm
Python Code
[
Download
]
from collections import defaultdict from math import factorial,floor, sqrt, log, e from operator import mul def factor(n): p=defaultdict(int) r = n while r > 1: if not r % 2: c=2 else: c=3 while r % c > 0: c+=2 p[c]+=1 r /= c return [k**v for k,v in p.iteritems()] def biggest_n(n): return max([(n, sum(factor )) for n in xrange(lower , upper ) if sum(factor ) <= i])[0] primes = (lambda b: [x for x in range(2,b) if not [t for t in range(2,x) if not x%t]]) upper = (lambda i: e**(1.06*sqrt(i*log(i,e)))) def lower(n): p=primes x=[1] while sum <=i: if not p: x.append break x.append(p.pop ) return reduce(mul, x[:-1]) print biggest_n(10) raw_input('/end')
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.44 / 8
41 Votes
http://codebin.yi.org/892
page generated in 0.00 seconds