Problem:
 Score : 300 points    Problem Statement You are given an integer N .
Find the number of the positive divisors of N! , modulo 10^9+7 .      Constraints  1≤N≤10^3         Input The input is given from Standard Input in the following format:  N       Output Print the number of the positive divisors of N! , modulo 10^9+7 .        Sample Input 1 3      Sample Output 1 4  There are four divisors of 3!  =6 : 1 , 2 , 3 and 6 . Thus, the output should be 4 .       Sample Input 2 6      Sample Output 2 30       Sample Input 3 1000      Sample Output 3 972926972

Solution (Python):
import math
from collections import defaultdict


def trial_division(n):
    
    factor = []
    
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    
    if not factor:
        factor.append(n)
        factor.append(1)
        return factor
    else:
        factor.append(n)
        return factor

N = int(input())
l = defaultdict(int)
for i in range(1,N+1):
    for j in trial_division(i):
        if j != 1:
            l[j] += 1

ans = 1
for i in list(l.values()):
    ans *= (i+1)

print(ans%(10**9+7))

Solution (Python):
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for key, value in factor_dict.items():
    count *= value + 1
    count %= (1000000007)
print(count)

Solution (Python):

N = int(input())
mod = 10**9+7

divisors = [0]*(N+1)
for j in range(2,N+1):
    s = 0
    L = j
    while s == 0:
        for i in range(2,N+1):
            if L % i == 0:
                divisors[i] += 1
                L //= i
                if L == 1:
                    s = 1 
                break
cnt = 1
for div in divisors:
    if div > 0:
        cnt*=(div+1)
print(cnt%mod)

Solution (Python):
import math
n = math.factorial(int(input()))
i = 2
ans = 1
M = 10**9+7
while i*i <= n:
  cnt = 1
  while n%i == 0:
    cnt += 1
    n //= i
  ans *= cnt
  i += 1
if n != 1:
  ans *= 2
print(int(ans%M))

Solution (Python):

"""
C - Factors of Factorial
https://atcoder.jp/contests/arc067/tasks/arc067_a

"""
import sys



from collections import Counter

def prime_factor(N):
    factors = Counter()
    for i in range(2, int(N**0.5)+1):
        while N % i == 0:
            factors[i] += 1
            N //= i
    if N != 1:
        factors[N] = 1
    return factors


def solve(N):
    f = Counter()
    for i in range(1, N+1):
        f += prime_factor(i)

    MOD = 10**9 + 7
    ans = 1
    for k, v in f.items():
        ans = ans * (v+1) % MOD
    return ans


def main(args):
    N = int(input())
    ans = solve(N)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
N = int(input())

is_prime=[1]*(N+1) 
n_factors = {}

for p in range(2,N+1):
  if is_prime[p] == 0:
    continue
  else:
    q = 2*p
    while q <=N:
      is_prime[q] = 0
      q+=p
    for n in range(p,N+1):
      while n%p ==0:
        n_factors[p] = n_factors.get(p,0) + 1
        n=n//p

ans = 1
for f in n_factors.values():
  ans *= (f+1)
  ans %= 10**9+7
  
print(ans)

Solution (Python):
from collections import defaultdict
from itertools import chain


def fast_prime_set(n):
    
    
    if n < 4:
        return ({}, {}, {2}, {2, 3})[n]
    n_sqrt = int(n ** 0.5) + 1
    primes = {2, 3} | set(chain(range(5, n + 1, 6), range(7, n + 1, 6)))
    for i in range(5, n_sqrt, 2):
        if i in primes:
            primes.difference_update(range(i * i, n, i * 2))
    return primes


def prime_factorization(x):
    
    
    primes = fast_prime_set(1000)

    fact = defaultdict(int)
    for prime in primes:
        while x % prime == 0:
            fact[prime] += 1
            x //= prime
        if x == 1:
            break
        if x in primes:
            fact[x] += 1
            break
    return fact


n = int(input())
div_c = defaultdict(int)

for i in range(1, n+1):
    for item, cnt in prime_factorization(i).items():
        div_c[item] += cnt

div_c[1] = 0
ans = 1
mod = 10 ** 9 + 7

for c in div_c.values():
    ans *= (c + 1)
    ans %= mod

print(ans)

Solution (Python):
n=int(input())
p=[2]
d=[0 for i in range(n+1)]
for i in range (2,n+1):
    j=0
    t=i
    while len(p)>j:
        a=p[j]
        if(t%a==0):
            d[a]+=1
            t//=a
        else:
            j+=1
    else:
        if(t==i):
            d[t]+=1
            p.append(i)
ans=1
for i in d[2:]:
    ans*=i+1
print(ans%1000000007)

Solution (Python):
n=int(input())
l=[k for k in range(1,n+1)]
phrase=[]
ans=1
a=1
def prime(x):
    i=2
    while i*i<=x:
        if x%i==0:
            return False
        i+=1
    return True
for i in range(2,n+1):
    if prime(i):
        phrase.append(i)
for j in phrase:
    for m in range(n):
        while l[m]%j==0:
            a+=1
            l[m]=l[m]/j
    ans=ans*a
    a=1
print(ans%1000000007)

Solution (Python):
from collections import Counter

mod = 10**9 + 7

N = int(input())

c = Counter()

import math
def factoring(n):
    sup = math.floor(pow(n,1/2))
    for i in range(2,sup + 1):
        while n % i == 0:
            n //= i
            c[i] += 1
    if n != 1:
        c[n] += 1

    
for i in range(1,N+1):
    factoring(i)

c = c.values()

ans = 1
for i in c:
    ans *= i+1
    ans %= mod

print(ans)

Solution (Python):
n = int(input())
prime = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37)
factor = {}
for i in prime:
    factor[i] = 0

for i in range(n):
    test = i+1
    for j in prime:
        while test%j == 0:
            factor[j] += 1
            test //= j
    if test != 1:
        if test not in factor:
            factor[test] = 1
        else:
            factor[test] += 1

ans, MOD = 1, 10**9+7
for i in factor:
    ans *= factor[i]+1
    ans %= MOD
print(ans)

Solution (Python):
import math
import collections


def primes(x):
    if x < 2: return []

    primes = [i for i in range(x)]
    primes[1] = 0 

    
    for prime in primes:
        if prime > math.sqrt(x): break
        if prime == 0: continue
        for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0

    return [prime for prime in primes if prime != 0]

p = primes(10000)
dic = collections.defaultdict(int)
N = int(input())
mod = 10**9 +7
for i in range(1, N+1):
    for j in p:
        while i % j == 0:
            dic[j] += 1
            i = i // j
    ans = 1
for c in dic.values():
    ans *= (c+1)
    ans %= mod
print(ans)

Solution (Python):
import math
import collections


def primes(x):
    if x < 2: return []

    primes = [i for i in range(x)]
    primes[1] = 0 

    
    for prime in primes:
        if prime > math.sqrt(x): break
        if prime == 0: continue
        for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0

    return [prime for prime in primes if prime != 0]

p = primes(1000)
dic = collections.defaultdict(int)
N = int(input())
mod = 10**9 +7
for i in range(1, N+1):
    for j in p:
        while i % j == 0:
            dic[j] += 1
            i = i // j
    ans = 1
for c in dic.values():
    ans *= (c+1)
    ans %= mod
print(ans)

Solution (Python):
import math
import collections
def primes(n):
    a = list(range(2, n+1))
    primes = [2]
    for i in a:
        flag = True
        m = math.sqrt(i)
        for j in primes:
            if j > m:
                break
            else:
                if i % j == 0:
                    flag = False
                    break
        if flag:
            primes.append(i)
            
    return primes
p = primes(10000)
dic = collections.defaultdict(int)
N = int(input())
mod = 10**9 +7
for i in range(1, N+1):
    for j in p:
        while i % j == 0:
            dic[j] += 1
            i = i // j
    ans = 1
for c in dic.values():
    ans *= (c+1)
    ans %= mod
print(ans)

Solution (Python):
import math
import collections
def primes(n):
    a = list(range(2, n+1))
    primes = [2]
    for i in a:
        flag = True
        m = math.sqrt(i)
        for j in primes:
            if j > m:
                break
            else:
                if i % j == 0:
                    flag = False
                    break
        if flag:
            primes.append(i)
            
    return primes
p = primes(1000)
dic = collections.defaultdict(int)
N = int(input())
mod = 10**9 +7
for i in range(1, N+1):
    for j in p:
        while i % j == 0:
            dic[j] += 1
            i = i // j
    ans = 1
for c in dic.values():
    ans *= (c+1)
    ans %= mod
print(ans)

Solution (Python):
mo=10**9+7
n=int(input())
from collections import defaultdict
d=defaultdict(int)

for i in range(2,n+1):
    t=int(i**0.5+2)
    for j in range(2,t):
        while i%j==0:
            i//=j
            d[j]+=1
        if i==1:
            break
    if i>1:
        d[i]+=1
ans=1
for i in d.items():
    ans*=i[1]+1
    ans%=mo
print(ans)

Solution (Python):
def primes(x):
    if x < 2:
        return []

    primes = [i for i in range(x)]
    primes[1] = 0

    for prime in primes:
        if prime > x**0.5:
            break

        if prime == 0:
            continue

        for non_prime in range(2 * prime, x, prime):
            primes[non_prime] = 0

    return [prime for prime in primes if prime != 0]


N = int(input())
prime_arr = primes(N + 1)
arr = [1 for i in range(N + 1)]
for i in range(2, N + 1):
    n = i

    for prime in prime_arr:
        while n % prime == 0:
            n //= prime
            arr[prime] += 1
        if n == 1:
            break

ans = 1
for v in arr:
    ans *= v

print(ans % (1000000007))

Solution (Python):
from collections import Counter

def factoring(N, factor_prev):
    '''
    input:
    N, factor_prev: 素因数分解すべきN, Nまでに存在する素数のリスト
    output
    N_dict, factor_list: Nの素因数分解の辞書: 例えば12の場合{2: 2, 3: 1}, Nが素数の場合はfactor_prevにNを追加して返す。Nが素数でない場合は引数を返す。
    '''
    
    factor_list = factor_prev
    N_dict = {}
    
    while True:
        if N == 1:
            return N_dict, factor_list
        
        for factor in factor_prev:
            if N % factor == 0:
                N = N // factor
                
                
                if factor in N_dict:
                    N_dict[factor] += 1
                    break
                    
                else:
                    N_dict[factor] = 1
                    break
                    
            
            if factor == factor_prev[-1] and N % factor != 0:
                factor_list.append(N)
                N_dict[N] = 1
                return N_dict, factor_list
              
def factorial_factoring(N):
    
    if N == 1:
        return {2: 0}
    
    else:
        factorial_factoring_dict = {}
        
        for i in range(2, N+1):
            if i == 2:
                N_dict = {2: 1}
                factor_prev = [2]
                factorial_factoring_dict = Counter(factorial_factoring_dict) + Counter(N_dict)
            else:
                N_dict, factor_prev = factoring(i, factor_prev)
                factorial_factoring_dict = Counter(factorial_factoring_dict) + Counter(N_dict)
    
    return(factorial_factoring_dict)
  
divisor = 1
mod = 1000000007
N = int(input())
for _, v in factorial_factoring(N).items():
    divisor = divisor * (v + 1)
print(divisor % mod)

Solution (Python):
n = int(input())
prime = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37)
factor = {}
for i in prime:
    factor[i] = 0

for i in range(n):
    test = i+1
    for j in prime:
        while test%j == 0:
            factor[j] += 1
            test //= j
    if test != 1:
        if test not in factor:
            factor[test] = 1
        else:
            factor[test] += 1

ans, MOD = 1, 10**9+7
for i in factor:
    ans *= factor[i]+1
    ans %= MOD
print(ans)

Solution (Python):
N = int(input())
e = [0] * (N + 1)
MOD = 10 ** 9 + 7
for i in range(1, N + 1):
    K = i
    for j in range(2, i + 1):
        while K % j == 0:
            e[j] += 1
            K //= j

ans = 1
for i in range(1, N + 1):
    if e[i] > 0:
        ans *= e[i] + 1
        ans %= MOD

print(ans)

Solution (Python):
import numpy as np
def eratosthenes(n):
    is_prime = np.ones((n+1,), dtype=bool)
    is_prime[:2] = False
    for i in range(2,n+1):
        if is_prime[i]:
            is_prime[i*2::i]=False
    return np.arange(n+1)[is_prime]
Ps = eratosthenes(1000)
def divisor(n):
    for p in Ps:
        if p*p>n:return -1
        if n%p==0:return p
def prime_division(n):
    d={}
    while n>1:
        p=divisor(n)
        if p==-1:d[n]=d.get(n,0)+1;break
        else:d[p]=d.get(p,0)+1;n//=p
    return d

N=int(input())
d={}
for i in range(1,N):
  p=prime_division(i+1)
  for k,v in p.items():
    d[k]=d.get(k,0)+v
r=1
for v in d.values():
  r=r*(v+1)%1000000007
print(r)

Solution (Python):
import time
import math
def sieve(n):
    prime = []
    limit = math.sqrt(n)
    data = [i for i in range(2, n+1)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


n = int(input())
if n == 1:
    print(1)
    exit()
prime = sieve(n)
ans = 1
for sosu in prime:
    cnt = 0
    for i in range(2, n+1):
        num = i
        while num % sosu == 0:
            num //= sosu 
            cnt += 1
    ans *= (cnt + 1)
print(ans % (10**9 + 7))

Solution (Python):
n=int(input())
P=[2]
for i in range(3,n+1):
  flag=1
  for p in P:
    if i%p==0:
      flag=0
  if flag==1:
    P.append(i)
ans=1
for p in P:
  np=0
  x=1
  while p**x<=n:
    np+=n//(p**x)
    x+=1
  ans*=(1+np)
print(ans%(10**9+7))

Solution (Python):
n = int(input())

M = 1000000007


def isPrime(x):
    for i in range(2,x):
        if x%i==0:
            return False
    return True

primes = []
cnt = dict()
for i in range(2,1000):
    if isPrime(i):
        primes.append(i)
        cnt[i] = 0
for i in range(2,n+1):
    x = i
    for p in primes:
        if p>x:
            break
        while x%p==0:
            x//=p
            cnt[p]+=1

res = 1

for p,c in cnt.items():
    res = (res*(c+1))%M
print(res)

Solution (Python):
import math

N = int(input())

d = {}

def primeFactor(n):
    for i in range(2, int(math.sqrt(n)) + 1):
        while n % i == 0:
            d[i] += 1
            n = n // i
    if n != 1:
        if n in d.keys():
            d[n] += 1
        else:
            d[n] = 1
    

ans = 1
mod = 10**9 + 7

for i in range(1, N + 1):
    primeFactor(i)

for v in d.values():
    ans *= (v + 1) 
    ans %= mod

print(ans)

Solution (Python):
import math
n = int(input())
a = [2]
inf = (10 ** 9) + 7
for i in range(3, n+1, 2):
    ans = 'y'
    for j in range(3, i//2, 2):
        if i % j == 0:
            ans = "n"
            break
    if ans == "y":
        a.append(i)
k = math.factorial(n)
ans = 1
for aa in a:
    t = 0
    while (k % aa == 0):
        if k % aa == 0:
            k = k // aa
            t += 1
    ans = (ans * (t+1)) % inf
print(ans)

Solution (Python):

import math


N = int(input())
mod = 10**9 + 7
nFact = math.factorial(N)
i = 2
ans = 1


while i * i <= nFact:
    cnt = 1
    
    while nFact % i == 0:
        cnt += 1
        nFact //= i
    ans *= cnt
    i += 1
if nFact != 1:
    ans *= 2


print(ans % mod)

Solution (Python):
n=int(input())
d=dict()
for i in range(1,n+1):
  for j in range(1,i+1):
    if j==1:
      continue
    while i%j==0:
      if j not in d:
        d[j]=1
      else:
        d[j]+=1
      i//=j
ans=1
for i in d.values():
  ans*=i+1
print(ans%1000000007)

Solution (Python):

import math

import math

def trial_division(n):
    
    factor = [0]
    
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            if(num != 1):
                factor.append(num)
    
    if not factor:
        return n
    else:
        factor.append(n)
        return factor

def main():
    N = int(input())
    result = 1
    divisor = []

    for i in range(1, N+1):
        divisor.extend(trial_division(i))

    for i in range(2,N+1):
        result = result*(divisor.count(i)+1)

    print(result % (10 ** 9 + 7))


if __name__ == "__main__":
    main()

Solution (Python):
N = input()
mod = 10 ** 9 + 7
num_p = [1] * 1001
p = []

for i in range(2, N + 1):
  canDivide = True
  for j in range(2, i):
    if i % j == 0:
      canDivide = False
      break
  if canDivide:
    p.append(i)


for i in range(2, N + 1):
  for j in p:
    c = 0
    while i % j == 0:
      c += 1
      i /= j
    num_p[j] = (num_p[j] + c) % mod

print reduce(lambda x, y: x * y, num_p) % mod

Solution (Python):
n = int(input())
table = {}
def prime_decomposition(n):
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            if not i in table:
                table[i] = 1
                n /= i
            else:
                n /= i
                table[i] += 1
        i+=1
    if n>1:
        if not n in table:
            table[int(n)] = 1
        else:
            table[int(n)] += 1
    return 0
for i in range(1,n+1):
    prime_decomposition(i)
ans = 1
for key in table.keys():
    ans *= (table[key]+1)
print(ans%(10**9+7))

Solution (Python):
import math


def is_prime(X):
  if (X == 1): 
    return 0
  for i in range(2, int(math.sqrt(X)) + 1):
   if (X % i) == 0: return 0
  return 1


def prime_factorization(X,Factoring):
 
 p,P = 2,X
 if(is_prime(P) == 1): Factoring[P] = 1
 else:
  while(1):
   if(P <= p+1):
     break
   count = 0
   while(X%p == 0):
     X = X//p
     count += 1
   if(count != 0):
    if(p in Factoring): Factoring[p] += count
    else: Factoring[p] = count
   p += 1   
 return Factoring


N = int(input())
A = {}
ans = 1
for i in range(2,N+1):
 A = prime_factorization(i,A)
for k, v in A.items():
 ans = ans*(v+1)
 
print(ans%(10**9+7))

Solution (Python):
import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    
    
    
    is_prime = array.array("B", (True for i in range(end)))
    
    is_prime[0] = False
    is_prime[1] = False
    
    primes = array.array(typecode)
    
    for i in range(2, end):
        if is_prime[i]:  
            primes.append(i)  
            for j in range(2 * i, end, i):  
                is_prime[j] = False  
    return primes.tolist()

n = int(input())
a = prime(n+1)
ans = 1
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  b += 1
  ans *= b
  ans %= mod
print(ans)

Solution (Python):
import math

def is_prime(n):
    if n == 2 or n == 3: return True
    if n%2 == 0 or n < 2: return False
    for i in range(3, int(n**0.5)+1, 2):
        if n%i == 0:
            return False
    return True

N = int(input())
ans = 1
for p in [i for i in range(N+1) if is_prime(i)]:
    e = 0
    for n in range(1, N+1):
        while n % p == 0:
            n //= p
            e += 1
    ans *= e + 1
ans %= 10**9 + 7
print(ans)

Solution (Python):
import math
N = int(input())
ans = 0
s = 0
primes = [2]
i = 3
while i <= N:
    all(i % p != 0 for p in primes) and primes.append(i)
    i += 2
l = [0] * len(primes)
for i, p in enumerate(primes):
    j = 1
    while p ** j <= N:
        l[i] += (N // (p ** j))
        j += 1
ans = 1
for n in l:
    ans *= (n + 1)
print(ans % (10 ** 9 + 7))

Solution (Python):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())


def era(n):
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    data1 = []
    for d in data:
        data1.append([d, 1])
    return data1


mod = 10 ** 9 + 7
n = ni()
lis = era(n)
for i in range(1, n + 1):
    for j in range(len(lis)):
        if i < lis[j][0]:
            break
        elif i % lis[j][0] == 0:
            count = 0
            m = i
            while(m % lis[j][0] == 0):
                m = m // lis[j][0]
                count += 1
            lis[j][1] += count
ans = 1
for i in range(len(lis)):
    ans *= lis[i][1]
    ans %= mod
print(ans)

Solution (Python):
import math
n = int(input())
n = math.factorial(n)
i = 2
MOD = 10 ** 9 + 7
ans = 1
while i * i <= n:
    cnt = 1
    while n % i == 0:
        cnt += 1
        n //= i
    ans *= cnt
    i += 1

if n != 1:
    ans *= 2

print(ans % MOD)

Solution (Python):
N = input()
mod = 10 ** 9 + 7
num_p = [1] * 1001
p = []

for i in range(2, N + 1):
  canDivide = True
  for j in range(2, i):
    if i % j == 0:
      canDivide = False
      break
  if canDivide:
    p.append(i)


for i in range(2, N + 1):
  for j in p:
    c = 0
    while i % j == 0:
      c += 1
      i /= j
    num_p[j] = (num_p[j] + c) % mod

print reduce(lambda x, y: x * y, num_p) % mod

Solution (Python):
N = input()
mod = 10 ** 9 + 7
num_p = [1] * 1001
p = []

for i in range(2, N + 1):
  canDivide = True
  for j in range(2, i):
    if i % j == 0:
      canDivide = False
      break
  if canDivide:
    p.append(i)


for i in range(2, N + 1):
  for j in p:
    c = 0
    target = i
    while target % j == 0:
      c += 1
      target /= j
    num_p[j] = (num_p[j] + c) % mod

print reduce(lambda x, y: x * y, num_p) % mod

Solution (Python):
from collections import defaultdict

primes = defaultdict(int)

N = int(input())

import itertools
def prime_factors(n):
    for i in itertools.chain([2], itertools.count(3, 2)):
        if n <= 1:
            break
        while n % i == 0:
            n //= i
            yield i

for i in range(1, N+1):
    for p in prime_factors(i):
        primes[p] += 1

total = 1
for c in primes.values():
    total *= c + 1
print(total % (10**9 + 7))

Solution (Python):
N = int(input())
 
d = {}
for i in range(2,N+1):
    tmp = i
    for j in range(2,N+1): 
        while tmp%j==0:
            tmp //= j
            d[j] = d.get(j,0)+1
            
ans = 1
for k in d:
    ans *= d[k]+1
    ans %= 10**9+7
print(ans)

Solution (Python):
from math import*
n=factorial(int(input()))

def dv(n):
    if n==1:
        return 1
    divisorsNum=1
    i=2
    while i*i<=n:
        cnt=1
        while n%i==0:
            cnt+=1
            n//=i
        divisorsNum*=cnt
        i+=1
    return divisorsNum*2
mod=(10**9+7)
print(dv(n)%mod)

Solution (Python):
N=int(input())
comp=[0 for i in range(N+1)]

for n in range(1,N+1):
    for i in range(2,N+1):
        while n%i==0:
            comp[i]+=1
            n//=i
        if n==1:
            break
MOD=10**9+7
res=1
for c in comp:
    res*=c+1
    res%=MOD
print(res)

Solution (Python):
from collections import defaultdict as dd
primes = dd(int)
n = int(input())
for i in range(2,n+1):
  for j in range(2,int(i**.5)+2):
    while i%j == 0:
      i //= j
      primes[j] += 1
  if i > 1:
    primes[i] += 1
cnt = 1
mod = 10**9+7
for x in primes:
  cnt *= primes[x]+1
  cnt %= mod
print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
from functools import partial, reduce
from operator import mul
prod = partial(reduce, mul)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

from collections import Counter
primes = list(range(1001))
primes[1] = 0
for i in range(2, int(1000 ** 0.5) + 1):
    if primes[i]:
        for j in range(2 * i, 1001, i):
            primes[j] = 0
primes = [p for p in primes if p != 0]

def main():
    N = II()
    primefactors = Counter()
    for n in range(1, N+1):
        for p in primes:
            if n == 1:
                break
            while n % p == 0:
                primefactors[p] += 1
                n //= p
    ans = reduce(lambda x, y: x * (y+1), primefactors.values(), 1) % MOD
    return ans

print(main())

Solution (Python):
thelist=[2]
for i in range(3,1000):
        t=0
        for j in range(2,i):
            if i%j==0:
                t=1
                continue
        if t==0:
            thelist.append(i)
while True:
    try:
        n=int(input())
    except:
        break
    thedic={}
    for i in thelist:
        thedic[i]=0
    for i in range(1,n+1):
        t=i
        j=0
        while j!=len(thelist):
            if t%thelist[j]==0:
                thedic[thelist[j]]+=1
                t=t/thelist[j]
                continue
            j=j+1
            if t==1:
                break
    value=1
    for i in thedic:
        value=value%(1000000000+7)*(thedic[i]+1)
    print(value%(1000000000+7))

Solution (Python):
def prime(N):
    p = 2
    koko = int(N**0.5)
    while N != 1:
        if N % p == 0:
            yaku[p] += 1
            N //= p
        elif p > koko:
            p = N
        else:
            p += 1
    return


N = int(input())

ans = 0
mod = 10**9 + 7
yaku = [0 for i in range(10**3)]
for i in range(1, N + 1):
    prime(i)

ans = 1
for a in yaku:
    ans *= a + 1
print(ans % mod)

Solution (Python):


"""
Created on 2019/2/
Solved on 2019/2/
@author: shinjisu
"""



import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


ALPHABET = [chr(i+ord('a')) for i in range(26)]
DIGIT = [chr(i+ord('0')) for i in range(10)]
N1097 = 10**9 + 7


def dmp(x, cmt=''):
    global debug
    if debug:
        if cmt != '':
            print(cmt, ':  ', end='')
        print(x)
    return x


def getDivisor(n):
    div = []
    for i in range(2, n+1):
        if n % i == 0:
            div.append(i)
    return div



def getPrime(n):
    prime = [2]
    num = [i for i in range(3, n+1, 2)]
    while num != []:
        p = num.pop(0)  
        prime.append(p)
        for a in num:  
            if a % p == 0:
                num.remove(a)
    return prime



def getPrimeFactor(n):
    if n <= 1:
        return [1], [1]
    prime = getPrime(n)
    factor = []
    power = []
    for a in prime:
        pw = 0
        while n % a == 0:
            pw += 1
            n //= a
        if pw > 0:
            factor.append(a)
            power.append(pw)
    return factor, power


def probC():
    N = getInt()
    dmp(N)
    divisor = zeros(N+1)
    for i in range(2, N+1):
        factor, power = getPrimeFactor(i)
        dmp((factor,power), 'factor,power')
        for j in range(len(factor)):
            divisor[factor[j]] += power[j]
    dmp(divisor)
    divCount = 1
    for i in range(2, N+1):
        divCount = divCount * (divisor[i]+1) % N1097
    return divCount


debug = False  
ans = probC()
print(ans)




"""
def getPrimeOld(n):
    prime = [2]
    num = [i for i in range(3, n+1, 2)]
    num.reverse()
    while num != []:
        p = num.pop()  
        prime.append(p)
        for a in num:  
            if a % p == 0:
                num.remove(a)
    return prime
"""

Solution (Python):
import math
N = math.factorial(int(input()))
ans = 1
M = 10**9+7
cnt = 1
for i in range(2,1001):
  while N%i == 0:
    cnt += 1
    N = N//i
  ans = ans*cnt
  i += 1
  cnt = 1
print(ans%M)

Solution (Python):
import math
N=math.factorial(int(input()))
i=2
ans=1
M=10**9+7
while i*i<=N:
    cnt=1
    while N%i==0:
        cnt+=1
        N//=i
    ans*=cnt
    i+=1
if N!=1:ans*=2
print(int(ans%M))

Solution (Python):
n = int(input())
query = [0]*1001
mod = 10**9+7
tmp = n
for tmp in range(1,n+1):
 for i in range(2,1002):
  while tmp%i == 0:
   query[i-1] += 1
   tmp = tmp//i
ans = 1
for i in query:
  ans= ans*(1+i)%mod
print(ans%mod)

Solution (Python):
from functools import reduce


def primes_list(N):
    l = [v for v in range(2, N+1)]
    ret = []
    while l:
        cur = l.pop(0)
        l = list(filter(lambda x: x % cur != 0, l))
        ret.append(cur)
    return ret


mod = 10**9+7
N = int(input())

l = [0]*(N+1)
primes = primes_list(N)

for i in range(2, N+1):
    for p in primes:
        if p > i:
            break
        tmp = 0
        while i % p == 0:
            i //= p
            tmp += 1
        l[p] += tmp

ans = 1
for i in l:
    if i == 0:
        continue
    else:
        ans = ans*(i+1) % mod
print(ans)

Solution (Python):
from collections import Counter

def trial_division(n):
    a = []  
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2   
    if n != 1: a.append(n)
    
    return a

N = int(input())
D = {}
for i in range(1,N+1) :
    C = dict(Counter(trial_division(i)))
    for j in C :
        if j not in D :
            D[j] = C[j]
        else :
            D[j] += C[j]
ans = 1
for i in D.values() :
    i %= 10**9+7
    ans *= i+1
    ans %= 10**9+7
print(ans)

Solution (Python):



def solve(m: int):
    from math import sqrt

    ans = dict()
    remain = m

    for j in range(2, int(sqrt(m)) + 1):
        if remain % j == 0:
            count = 0

            while remain % j == 0:
                count += 1
                remain //= j

            ans[j] = count

    if remain != 1:
        ans[remain] = 1

    return ans


def main():
    n = int(input())
    d = dict()
    mod = 10 ** 9 + 7
    ans = 1

    for i in range(2, n + 1):
        new = solve(i)

        for key, value in new.items():
            if key not in d.keys():
                d[key] = value
            else:
                d[key] += value

    for di in d.values():
        ans *= (di + 1)
        ans %= mod

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
MOD = 10**9 + 7


def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2, N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


N = int(input())
if N == 1:
    print(1)
    exit()
N_list = seachPrimeNum(N)
ans_list = [0 for i in range(len(N_list))]
for i in range(2, N+1):
    temp_i = i
    for j in range(len(N_list)):
        while temp_i % N_list[j] == 0:
            temp_i = temp_i // N_list[j]
            ans_list[j] += 1
ans = 1
for i in range(len(ans_list)):
    ans = ans * (ans_list[i]+1) % MOD
print(ans)

Solution (Python):
from math import factorial

n = factorial(int(input()))
cnt = 2
k = 1
ans = 1

while n != 1:
    if n % cnt == 0:
        n //= cnt
        k = k + 1
    else:
        ans = ans * k
        k = 1
        cnt += 1
anw = (ans * k) % (10**9 + 7)
print(anw)

Solution (Python):
N = int(input())
MOD = int(1e+9) +7 
prime = [2]

for i in range(2,1001):
    for j in range(2, i-1):
        if i % j == 0:
            break
    else:
        prime.append(i)

factor = [1] * 1000

for i in range(1, N+1):
    for p in prime:
        if i == 1:
            break
        while i % p == 0:
            i /= p 
            factor[p] += 1

ans = 1
for fact in factor:
    ans *= fact
    ans %= MOD
print(int(ans))