import requests
from math import prod
from collections import Counter
import bisect
req = requests.get("https://[Log in to view URL]")
data = req.text
seq = []
for row in data.split('\n'):
_, v = map(int, row.split())
seq.append(v)
def factor(m):
n = m
f = []
for d in [2, 3, 5]:
while n % d == 0:
f.append(d)
n //= d
inc = (4, 2, 4, 2, 4, 6, 2, 6)
i, d = 0, 7
while d * d <= n:
while n % d == 0:
n //= d
f.append(d)
d += inc[i]
i = (i + 1) % 8
if n > 1:
f.append(n)
return Counter(f)
def max_divisors(n):
if n <= 2:
return n
idx = bisect.bisect_left(seq, n + 1)
m = seq[idx - 1]
cnt = factor(m)
return prod(v + 1 for _, v in cnt.items())
To embed this program on your website, copy the following code and paste it into your website's HTML: