-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path012.py
72 lines (52 loc) · 1.34 KB
/
012.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# !/usr/bin/python3
# -*- coding: utf-8 -*-
print(f'----------------------12--')
from collections import Counter
def get_ls(n): # ДЕЛИТЕЛИ
"""Разложить число на множители"""
# result = [1]
result = []
i = 2
while i < n:
if n % i == 0:
n /= i
result.append(i)
else:
i += 1
result.append(int(n))
return result
def delitel_max(zzz):
ls = get_ls(zzz)
kkk = dict(Counter(ls)).items()
d = [k for k, _ in kkk]
m = [v for _, v in kkk]
k = [0 for _ in range(len(set(ls)))]
ln = range(len(m))
max = 0
try:
while True:
r = 1
for i1, i2 in zip(d, k):
r *= i1 ** i2
# print(r)
max += 1
k[0] += 1
for i in ln:
if k[i] > m[i]:
k[i] = 0
k[i + 1] += 1 # IndexError
except IndexError:
pass
return max
for n in range(1, 10000000000):
# print('>>>', n - 1, '-e TREUG: ', end='')
treug = 0
for i in range(0, n):
treug += i
# print(treug, end='')
tmp = delitel_max(treug)
# print(' deliteley:', tmp)
# print(n - 1, '-e teyg 4islo:', zz, 'deliteley:', delitel)
if tmp >= 500:
print('>>>', treug)
quit()