@anonymous/

FloweryGargantuanSeahog

Python 2.7

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7889838350887357","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSBwcmltZWZhYyBpbXBvcnQgZmFjdG9yaW50LCBpc3ByaW1lLCBwcmltZWZhYw0KaW1wb3J0IHRpbWUNCg0KI3ByaW50IGlzcHJpbWUoOTkxOTQ4NTMwOTQ3NTU0OTcpDQojcHJpbnQgZmFjdG9yaW50KDk5MTk0ODUzMDk0NzU1NDk3KQ0KDQpkZWYgSFAobik6DQoJZmFjdG9ycyA9IGxpc3QocHJpbWVmYWMobikpDQoJDQoJI3ByaW50IG4sIGZhY3RvcnMNCgkNCglpZiBsZW4oZmFjdG9ycykgPT0gMSBhbmQgbiBpbiBmYWN0b3JzOg0KCQlyZXR1cm4gbg0KCQ0KCW4gPSAiIg0KCWZvciBmIGluIHNvcnRlZChmYWN0b3JzKToNCgkJbiArPSBzdHIoZikNCglyZXR1cm4gSFAoaW50KG4pKQ0KDQpmb3IgaSBpbiBbMTYsMjAsNjQsNjUsODBdOg0KCXRvdGFsID0gMC4wDQoJY291bnQgPSAxDQoJZm9yIF8gaW4geHJhbmdlKGNvdW50KToNCgkJdDAgPSB0aW1lLmNsb2NrKCkNCgkJcHJpbnQgSFAoaSkNCgkJdDEgPSB0aW1lLmNsb2NrKCkNCgkJdGFrZW4gPSAodDEgLSB0MCkNCgkJdG90YWwgKz0gdGFrZW4NCglwcmludCAiXHRcdCIsIHRvdGFsIC8gY291bnQsICJcbiINCg=="},"asBuffer":null},"loaded":true}}
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
from primefac import factorint, isprime, primefac
import time

#print isprime(99194853094755497)
#print factorint(99194853094755497)

def HP(n):
	factors = list(primefac(n))
	
	#print n, factors
	
	if len(factors) == 1 and n in factors:
		return n
	
	n = ""
	for f in sorted(factors):
		n += str(f)
	return HP(int(n))

for i in [16,20,64,65,80]:
	total = 0.0
	count = 1
	for _ in xrange(count):
		t0 = time.clock()
		print HP(i)
		t1 = time.clock()
		taken = (t1 - t0)
		total += taken
	print "\t\t", total / count, "\n"