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):
n = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
d = {}
for i in range(2, n+1):
  a = factorization(i)
  for i in a:
    if i[0] not in d.keys():
      d[i[0]] = i[1]
    else:
      d[i[0]] += i[1]
ans = 1
for value in d.values():
  ans *= value+1
print(ans%(10**9+7))

Solution (Python):
from math import factorial

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

ans = 1
for i in range(2, N+1):
    count = 1
    while fn % i == 0:
        count += 1 
        fn //= i 
    ans *= count
print(ans%mod)

Solution (Python):
import math

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

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


E=get_sieve_of_eratosthenes(n)

l=len(E)



co=1

for e in E:
    co_sub=1
    
    l_sub=int(math.log(n,e))
    
    for j in range(1,l_sub+1):
        
        co_sub+=n//(e**j)
    co*=co_sub
    
    co%=mod
    
print(co)

Solution (Python):
import math


def sieve_of_eratosthenes(n):
    if n == 1:
        return []
    limit = int(math.sqrt(n))
    targets = [i for i in range(2, n + 1)]
    primes = []
    while targets[0] <= limit:
        p = targets[0]
        primes.append(p)
        targets = [i for i in targets if i % p != 0]
    primes.extend(targets)
    return primes


n = int(input())
p = sieve_of_eratosthenes(n)
ans = 1
for i in p:
    cnt = 0
    for j in range(2, n + 1):
        while j % i == 0:
            j //= i
            cnt += 1
    ans *= cnt + 1
    ans %= 10 ** 9 + 7
print(ans)

Solution (Python):
import math


def sieve_of_eratosthenes(n):
    if n == 1:
        return []
    limit = int(math.sqrt(n))
    targets = [i for i in range(2, n + 1)]
    primes = []
    while targets[0] <= limit:
        p = targets[0]
        primes.append(p)
        targets = [i for i in targets if i % p != 0]
    return primes + targets


n = int(input())
p = sieve_of_eratosthenes(n)
ans = 1
for i in p:
    cnt = 0
    for j in range(2, n + 1):
        while j % i == 0:
            j //= i
            cnt += 1
    ans *= cnt + 1
    ans %= 10 ** 9 + 7
print(ans)

Solution (Python):
import math


def sieve_of_eratosthenes(n):
    max_prime = int(math.sqrt(n))
    targets = [i for i in range(2, n + 1)]
    primes = []
    if n == 1:
        return primes
    while targets[0] <= max_prime:
        p = targets[0]
        primes.append(p)
        targets = [i for i in targets if i % p != 0]
    primes.extend(targets)
    return primes


n = int(input())
p = sieve_of_eratosthenes(n)
ans = 1
for i in p:
    cnt = 0
    for j in range(2, n + 1):
        while j % i == 0:
            j //= i
            cnt += 1
    ans *= cnt + 1
    ans %= 10 ** 9 + 7
print(ans)

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
ans = 0 ;count = 0 ;pro = 1
mod=10**9+7

def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        count=0
        while n % i==0:
            count+=1
            n = n//i
        if count!=0:
            ass.append((i,count))
    if n != 1:
        ass.append((n,1))
    return ass

data=[1]*10**4
n=int(input())
for i in range(2,n+1):
    for ai ,c in prime_factor(i):
        data[ai]=(data[ai]+c)%mod
for di in data:
    pro*=di
    pro%=mod
print(pro)

Solution (Python):
import math
import collections
N = int(input())
mod = 10 ** 9 + 7

def prime_factorize(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

c = collections.Counter(prime_factorize(math.factorial(N)))
prime_factors = list(c.values())
answer = 1

for i in range(len(prime_factors)):
    answer *= (prime_factors[i] + 1)

print(answer % mod)

Solution (Python):
import math
import collections
N = int(input())
mod = 10 ** 9 + 7
def prime_factorize(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



c = collections.Counter(prime_factorize(math.factorial(N)))

orion = list(c.values())
unizon = 1
for i in range(len(orion)):
    unizon *= (orion[i]+1)

print(unizon % mod)

Solution (Python):
import sys
from math import floor, sqrt
from collections import defaultdict

MOD = 10 ** 9 + 7

n = int(sys.stdin.readline().rstrip())

res = defaultdict(int)

def primeFactorize(n):
    while n % 2 == 0:
        res[2] += 1
        n //= 2
    if n == 1:
        return
    for i in range(3, floor(sqrt(n))+1, 2):
        while n % i == 0:
            res[i] += 1
            n //= i
        if n == 1:
            return
    res[n] += 1

def main():
    for i in range(1, n+1):
        primeFactorize(i)
    
    ans = 1
    for c in res.values():
        ans *= c + 1
        ans %= MOD
    
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
def prm(a):
  if a==1 or a == 4:
    return False
  for i in range(2,int(a**0.5+1)):
    if a%i==0:
      return False
  else:
    return True
x=int(input())
d=[1]*(x+1)
for i in range(1,x+1):
  if prm(i):
    d[i]+=1
  else:
    while not prm(i) and i != 1:
      for j in range(2,i):
        if i%j==0:
          d[j]+=1
          i=i//j
          break
    if i!= 1:
      d[i]+=1
ans=1

for i in range(x+1):
  ans = ans * d[i] % (10**9+7)
print(ans)

Solution (Python):
from collections import defaultdict


def factorize2(n):
    """
    nの値を素因数分解し、素因数とその指数をtupleにまとめたリストを返す
    """
    b = 2
    fct = []
    while b * b <= n:
        cnt = 0
        while n % b == 0:
            cnt += 1
            n //= b
        if cnt > 0:
            fct.append((b, cnt))
        b += 1
    if n > 1:
        fct.append((n, 1))
    return fct


MOD = 10 ** 9 + 7
N = int(input())
d = defaultdict(int)
for i in range(1, N + 1):
    for n, c in factorize2(i):
        d[n] += c

ans = 1
for n, c in d.items():
    ans *= c + 1
    ans %= MOD
print(ans)

Solution (Python):
n=int(input())
klist=[]
MOD=10**9+7
ans=1
kaijo=list(range(n+1))
for i in range(2,n+1):
    kaisu=0
    for j in range(1,n+1):
        while kaijo[j]%i==0:
            kaijo[j]=kaijo[j]//i
            kaisu+=1
    if kaisu!=0:
        klist.append(kaisu%MOD)
for i in range(len(klist)):
    ans*=((klist[i]+1)%MOD)
ans=ans%MOD
print(ans)

Solution (Python):
def PF(n):
    fs = []
    q = int(n ** 0.5) 
    for i in range(2, q + 1):
        if n % i == 0:
            r = 0
            while n % i == 0:
                n //= i
                r += 1
            fs.append([i, r])
    if n != 1:
        fs.append([n, 1])
    return fs

P=[0]*1000
x=1
N=int(input())
for i in range(2,N+1):
  A=PF(i)
  for j in range(len(A)):
    P[A[j][0]]=P[A[j][0]]+A[j][1]
P.remove(0)
for i in range(len(P)):
  x=(x*(P[i]+1))%(10**9+7)
print(x)

Solution (Python):
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return is_prime, table
N=int(input())
_, table = sieve(N)
d={}
for p in table:
    sum_=0
    calc=p
    while calc <= N:
        sum_ += N//calc
        calc *= p
    d[p] = sum_
    
lim = 10**9+7
ans=1
for i in d.values():
    ans = (ans * (i+1)) % lim
print(ans)

Solution (Python):
def PF(n):
    fs = []
    q = int(n ** 0.5) 
    for i in range(2, q + 1):
        if n % i == 0:
            r = 0
            while n % i == 0:
                n //= i
                r += 1
            fs.append([i, r])
    if n != 1:
        fs.append([n, 1])
    return fs

n = int(input())
p = [0] * 1001
for i in range(2, n + 1):
    for j in PF(i):
        p[j[0]] += j[1]

ans = 1
mod = int(1e9 + 7)
for i in range(2, n + 1):
    ans = ans * (p[i] + 1) % mod
print(ans)

Solution (Python):
N = int(input())
if N == 1:
    print(1)
    exit()
P = 10**9+7
d = {}
for i in range(2,N+1):
    k = i
    for j in range(2,i):
        while i%j == 0:
            i = i//j
            if j in d.keys():
                d[j] += 1
            else:
                d[j] = 1
    if k == i:
        d[i] = 1
ans = 1
for v in d.values():
    ans = ans*(v+1)%P
print(ans)

Solution (Python):
import collections
import math

def trial_division(n):
    if n < 2:
        return []

    prime_factors = []

    for i in range(2, int(n**0.5)+1):
        
        while n % i == 0:
            
            prime_factors.append(i)
            
            n //= i
    
    if n > 1:
        prime_factors.append(n)

    return prime_factors

n = int(input())
mod = 10**9+7
ans = 1
pf = []
f = math.factorial(n)


for i in range(2, n+1):
    
    pf += trial_division(i)



pfMap = collections.Counter(pf)


for key, value in pfMap.items():
    ans *= value + 1
    ans %= mod

print(ans % mod)

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

primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

d = dict()
for i in range(len(primes)):
    d[primes[i]] = i

def prime_factorize(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

l = [0] * len(primes)
for i in range(1, n+1):
    divisors = prime_factorize(i)
    for dv in divisors:
        idx = d[dv]
        l[idx] += 1
    
    tmp = 1
    for j in range(len(primes)):
        tmp *= (l[j] + 1)

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

Solution (Python):
import math

n=int(input())

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

e=get_sieve_of_eratosthenes(n)
l=len(e)

co=1
for i in range(l):
    k=e[i]
    co_sub=1
    l_sub=int(math.log(n,k))
    for j in range(1,l_sub+1):
        co_sub+=n//(k**j)
    co*=co_sub
    co%=(10**9+7)
    
print(co)

Solution (Python):






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











yakusu = [0 for _ in range(10**3 + 1)]
for n in range(2, N+1):
    for i in range(2, 10 ** 3):
        count = 0
        while n % i == 0:
            count += 1
            n //= i
        if count > 0:
            yakusu[i] = (yakusu[i]+count) % MOD
        if n == 1:
            break
    





yakusu






ans = 1
for i in yakusu:
    if i > 0:
        ans = ans * (i+1) % MOD
print(ans)

Solution (Python):
N = int(input())
prime = []
l = [False] * (N+1)

for i in range(2, N+1):
  if l[i]: continue
  prime.append(i)
  j = 1
  while i * j <= N:
    l[i * j] = True
    j += 1

ans = 1
for i in prime:
  r = 1
  j = 1
  while i ** j <= N:
    k = 1
    while i ** j * k <= N:
      r += 1
      k += 1
    j += 1
  ans = ans * r % (10 ** 9 + 7)

print(ans)

Solution (Python):
import math


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N = int(input())
    MOD = 10**9 + 7

    A = [0 for _ in range(N + 1)]
    for i in range(2, N + 1):
        x = factorization(i)
        for a, b in x:
            A[a] += b

    ans = 1
    for a in A:
        ans *= (a + 1)
        ans %= MOD

    print(ans)


main()

Solution (Python):

from collections import defaultdict
MOD = 10**9+7
N = int(input())
d = defaultdict(int)


for i in range(2,N+1):
    p = 2
    x = i
    
    while p * p <= x:
        while x % p == 0:
            d[p] += 1
            x //= p
        p += 1
    
    if x > 1:
        d[x] += 1
    
ans = 1
for k in d.keys():
    ans *= (d[k] + 1)

print(ans%MOD)

Solution (Python):
import math
def trial_division(n):
    a = []
    for i in range(2,int(math.sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            a.append(i)
    if n != 1:
        a.append(n)
    return a
N = int(input())
MOD = 10**9 + 7
ans_arr = [1]*(N+1)
for i in range(2,N+1):
    for item in trial_division(i):
        ans_arr[item] += 1
ans = 1
for item in ans_arr:
    ans *= item
    ans %= MOD
print(ans)

Solution (Python):
from collections import defaultdict
MOD = 10**9+7
N = int(input())
ans = 1
ary = defaultdict(int)
for i in range(1, N+1):
    n = i
    m = 2
    while n > 1:
        if not n % m:
            ary[m] += 1
            n //= m
            m = 1
        m += 1
for v in dict(ary).values():
    ans *= v+1
    ans %= MOD
print(ans)

Solution (Python):
import math


def f(n):
    r = dict()
    while n != 1:
        for i in range(2, n+1):
            while n % i == 0:
                r[i] = r.get(i, 0) + 1
                n //= i
    return r


def main():
    N = int(input())
    ds = []
    for i in range(2, N+1):
        x = f(i)
        ds.append(x)
    

    d = {}
    for di in ds:
        for k in di.keys():
            v = di.get(k)
            
            d[k] = d.get(k, 0) + v

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



if __name__ == "__main__":
    main()

Solution (Python):
N=int(input())
import numpy as np
lis=np.array([1]*N)
mod=10**9+7
def prime_fac(n,l):
  for i in range(2,int(n**(1/2))+1):
    count=0
    while n%i==0:
      n=n//i
      count+=1
      
    l[i-1]+=count
    
  if n!=1:
    l[n-1]+=1
  return l
  
for i in range(2,N+1):
  lis=prime_fac(i,lis)
  
ans=1
lis=lis[lis>1]
for i in lis:
  ans=ans*i%mod
print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
from heapq import heappush, heappop
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

def factorization(n):
   arr = []
   temp = n
   for i in range(2, int(-(-n**0.5//1))+1):
       if temp%i==0:
           cnt=0
           while temp%i==0:
               cnt+=1
               temp //= i
           arr.append([i, cnt])
   if temp!=1:
       arr.append([temp, 1])
   if arr==[]:
       arr.append([n, 1])
   return arr
if N == 1:
	print(1)
	sys.exit()

dic = defaultdict(int)
for i in range(2, N+1):
	fact = factorization(i)
	for n, power in fact:
		dic[n] += power

ans = 1
for n in dic.values():
	ans = (ans*(n+1))%mod
print(ans)

Solution (Python):
n = int(input())
primenumber = []
if n == 1 :
    primenumber = []
else :
    for i in range(2, n + 1) :
        for j in range(2, i + 1) :
            if i == j :
                pass
            elif i % j == 0 :
                break
        else :
            primenumber += [j]
powers = [0] * len(primenumber)
for i in range(len(primenumber)) :
    prime = primenumber[i]
    power = 0
    k = 1
    while n // (prime ** k) > 0 :
        power += n // (prime ** k)
        k += 1
    powers[i] = power + 1
ans = 1
for power in powers :
    ans *= power
print(ans % (10 ** 9 + 7))

Solution (Python):
N=int(input())
check=[0]*(N+1)

DIV=10**9+7
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

for i in range(2,N+1):
  facts=factorization(i)
  for fact in facts:
    check[fact[0]]+=fact[1]
    
ans=1
for c in check:
  if c==0:
    continue
  ans=((ans%DIV)*((c+1)%DIV))%DIV

print(ans)

Solution (Python):
from sys import stdin
import math
from itertools import groupby

n = int(stdin.readline().rstrip())
total = math.factorial(n)

def prime_factorize(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

li = prime_factorize(total)
lin = []
for key, value in groupby(li):
    lin.append(len(list(value)))

point = 1

for i in lin:
    point *= i+1
    point %= 10**9+7

print(point)

Solution (Python):
import collections
s = int(input())
a = []
def prime_factorize(n):
    global 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)

for i in range(2,s+1):
    prime_factorize(i)

c = collections.Counter(a)
ans = 1
for i in c.values():
    ans *= (i+1)
    ans %= 1000000007

print(ans)

Solution (Python):
def prime_factor(n):
    ret = {}
    p = 2

    while p*p <= n:
        while n % p == 0:
            ret[p] = ret.get(p, 0) + 1
            n //= p
        p += 1

    if n != 1: ret[n] = 1

    return ret

n = int(input())
d = {}

for i in range(2, n+1):
    t = prime_factor(i)
    for k, v in t.items():
        d[k] = d.get(k, 0) + v

ans = 1
mod = int(1e9) + 7

for _, v in d.items():
    ans *= (v+1)
    ans %= mod

print(ans)

Solution (Python):
n = int(input())
mod = 10**9+7
n_prime = [[2,0]]
x = 1
ans = 1
for i in range(2,n+1):
  for j in range(x):
    while(i % n_prime[j][0] == 0):
      n_prime[j][1] += 1
      i /= n_prime[j][0]
  if i != 1:
    n_prime.append([i,1])
    x += 1
for k in range(x):
  ans = ans * (n_prime[k][1]+1) % mod
print(ans)

Solution (Python):
n=int(input())
mod=10**9+7

import math
s=math.factorial(n)
i=2
ans=1
cnt=0
while s!=1:
    if s%i==0:
        s//=i
        cnt+=1
    else:
        ans*=(cnt+1)
        cnt=0
        i+=1

print(ans*(cnt+1)%mod)

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()

def prime_factorization(n):
    assert(n>1)
    factor=[]
    sqrt=int(n**.5)
    for d in range(2,sqrt+1):
        while(n%d==0):
            n//=d
            factor.append(d)
    if n!=1: factor.append(n)
    return factor

from collections import defaultdict

def resolve():
    n=int(input())
    C=defaultdict(int)
    for x in range(2,n+1):
        for p in prime_factorization(x):
            C[p]+=1
    ans=1
    for v in C.values():
        ans*=v+1
        ans%=MOD
    print(ans)
resolve()

Solution (Python):
def prime_factorize(n):
    res = []
    p = 2
    while p*p <= n:
        if n % p != 0:
            p += 1
            continue
        num = 0
        while n % p == 0:
            num += 1
            n //= p
        res.append( [p, num] )
        p += 1

    if n != 1: res.append( [n, 1] )

    return res



def mod_div_fact(n, mod):
    d = {}
    for i in range(2, n+1):
        L = prime_factorize(i)
        for (p, e) in L:
            d[p] = d.get(p, 0) + e
    res = 1
    for v in d.values():
        res *= (v+1)
        res %= mod
    return res;

n = int(input())
mod = int(1e9)+7

print(mod_div_fact(n, mod))

Solution (Python):
n=int(input())
yaku=set()
mod=7+10**9


primes=[]
for i in range(2,1001):
  flag=0
  for j in range(2,i):
    if j!=i and i%j==0:
      flag=1
      break 
  if flag==0:
    primes.append(i)


insu=[0]*len(primes)


for i in range(2,n+1):
  n=0
  while i!=1:
    if i%primes[n]==0:
      insu[n]+=1
      i=i//primes[n]
    else:
      n+=1

ans=1
for i in insu:
  ans*=(i+1)
  ans%=mod
print(ans)

Solution (Python):
n = int(input())
exps = [0] * 1003

for i in range(2, n+1):
    t = i
    div = 2
    while div*div <= i:
        if t % div == 0:
            exps[div] += 1
            t //= div
        else:
            div += 1
    if t != 1:
        exps[t] += 1

ans = 1
mod = int(1e9) + 7

for i in range(2, n+1):
    ans *= (exps[i] + 1)
    ans %= mod

print(ans)

Solution (Python):
n = int(input())
exps = [0] * 1003

for i in range(2, n+1):
    t = i
    div = 2
    while div*div <= n:
        if t % div == 0:
            exps[div] += 1
            t //= div
        else:
            div += 1
    if t != 1:
        exps[t] += 1

ans = 1
mod = int(1e9) + 7

for i in range(2, n+1):
    ans *= (exps[i] + 1)
    ans %= mod

print(ans)

Solution (Python):

import sys
from math import factorial
from collections import Counter
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
MOD = 10**9+7


def prime_factorize(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


ans = 1
for i in Counter(prime_factorize(factorial(n))).values():
    ans = ans*(i+1) % MOD
print(ans)

Solution (Python):
mod = 10 ** 9 + 7
n = int(input())
prime = {}


def prime_factorization(n):
    tmp = n
    for i in range(2, int(n**0.5)+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if i in prime:
                prime[i] += cnt
            else:
                prime[i] = cnt
    if tmp != 1:
        if tmp in prime:
            prime[tmp] += 1
        else:
            prime[tmp] = 1

for i in range(2, n+1):
    prime_factorization(i)

res = 1
for v in prime.values():
    res *= v + 1
    res %= mod

print(res)

Solution (Python):
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect
import itertools


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    SSSS = 1000000007
    count = collections.Counter()

    for i in range(1, N+1):
        target = i
        is_end = False
        while not is_end:
            is_end = True
            for j in range(2, int(math.sqrt(target)+1)):
                if target % j == 0:
                    count[j] += 1
                    target = target // j
                    is_end = False
                    break
            if is_end and target != 1:
                count[target] += 1
    c = 1
    for k, v in count.items():
        c *= (v + 1)
        c = c % SSSS
    return c


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Solution (Python):

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

prime = [2]
for i in range(N):
    I = i+1
    In = math.ceil(math.sqrt(I))
    flag = 0
    for j in range(In):
        J = j+1
        if I%J == 0 and J!=1:
            flag = 1
            break
    if flag == 0 and I!=1:
        prime.append(I)


ans = 1
for p in prime:
    q = 0
    pp = p
    while pp <= N:
        q+=(N//pp)
        pp*=p
    ans*=(q+1)
    
print(ans%mod)

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

NNN = [i for i in range(1,N+1)]
numofprime=[]

for i in range(2,N+1):
    counti = 0
    for j in range(len(NNN)):
        while True:
            if NNN[j] %i !=0:
                break
            NNN[j] = NNN[j]/i
            counti += 1
    numofprime.append([i,counti])



ans = 1
for i in numofprime:
    ans = ans*(i[1]+1) % mod


print(ans)

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

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

def factors(p, n):
    ret = 0
    m = p
    while m <= n:
        ret += n // m
        m *= p        
    return ret

ans = 1
for i in range(1, n+1):
    if prime(i):
        ans = ans * (factors(i, n) + 1) % (10**9 + 7)
print(ans)

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

def prime(n):
    ret = True
    for i in range(1, int(n**0.5) + 1):
        if i != 1 and n % i == 0:
            ret = False
            break
    return ret

def factors(p, n):
    a = p
    ret = 0
    while p <= n:
        ret += n // p
        p *= a
    return ret

ans = 1
for i in range(2, n+1):
    if prime(i):
        ans = ans * (factors(i, n) + 1) % (10**9 + 7)
print(ans)

Solution (Python):
N = int(input())
X = [-1] * (N+1)
Y = [0] * 1000
L = [{} for _ in range(N+1)]
k = 2
while k <= N:
    X[k] = 1
    L[k][k] = 1
    for i in range(k*2, N+1, k):
        X[i] = 0
        L[i][k] = 1
    d = 2
    while k**d <= N:
        for i in range(k**d, N+1, k**d):
            L[i][k] += 1
        d += 1
    while k <= N and X[k] >= 0:
        k += 1

for l in L:
    for p in l:
        Y[p] += l[p]

ans = 1
for y in Y:
    ans *= y + 1
print(ans % (10**9+7))

Solution (Python):
N = int(input())
ans = 1
divine = [1 for _ in range(N+1)]

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

for k in divine:
    ans *= k

print(ans%1000000007)

Solution (Python):
import math
N = int(input())
d = math.factorial(N)

k, ans = 1, 1
for i in range(2, N + 1):
    while d % i == 0:
        d //= i
        k += 1
    ans *= k
    k = 1
print(ans % (10**9 + 7))

Solution (Python):
def prime_factorize(n):
    while n % 2 == 0:
        a[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        a[n] += 1

N = int(input())
a = [0]*(N+1)
for i in range(2, N+1):
    prime_factorize(i)
ans = 1
for i in a:
    if i > 0:
        ans *= (i+1)
big = 10**9 + 7
print(ans % big)

Solution (Python):
N = int(input())
e = 10**9 + 7
P = []
for i in range(2,N+1):
    a = 1
    for p in P:
        if i % p == 0:
            a = 0
            break
    if a == 1:
        P.append(i)
d = {}
for p in P:
    d[p] = 1
for i in range(1,N+1):
    x = i
    for p in P:
        while x % p == 0:
            x = x//p
            d[p] += 1
ans = 1
for p in P:
    ans = (ans*d[p])%e
    
print(ans)

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

Solution (Python):
n=int(input())
data=[0]*(n+1)
for i in range(2,n+1):
    while i%2==0:
        i//=2
        data[2]+=1
    j=3
    while i>1:
        if i%j==0:
            i//=j
            data[j]+=1
        else:
            j+=2
ans=1
mod=10**9+7
for i in range(n+1):
    if data[i]!=0:
        ans=ans*(data[i]+1)%mod
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline


from collections import defaultdict
N = int(input())

Primes = []
is_prime = [True]*(N+1)
is_prime[0] = is_prime[1] = False

for i in range(2,N+1):
    if is_prime[i]:
        Primes.append(i)
        for j in range(i*2,N+1,i):
            is_prime[j] = False

dic = defaultdict(int)

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

ans = 1
mod = 10**9+7
for v in dic.values():
    ans *= v+1
    ans %= mod

print(ans)

Solution (Python):
def pff(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1: pf[m] = 1
    return pf

def examC(mod):
    N = I()
    ans = int(1)
    d = defaultdict(int)
    for i in range(2,N+1):
        m = pff(i)

        for v in m:
            d[v] += m[v]

    for i in d:
        ans = (ans*(d[i]+1))%mod
    print(ans)

import sys
import copy
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC(mod)

Solution (Python):
from collections import defaultdict
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


N = int(input())
Mod = 10 ** 9 + 7
if N == 1:
    print(1)
    exit()
d = defaultdict(int)
for i in range(2, N + 1):
    l = factorization(i)
    for j in range(len(l)):
        d[l[j][0]] += l[j][1]

l = list(d.values())
ans = 1
for i in range(len(l)):
    ans = ans * (l[i] + 1) % Mod
print(ans)

Solution (Python):
from collections import Counter
from functools import reduce

N = int(input())

def pf(n):
    if n == 1: return []
    f = []
    for i in range(2, n + 1):
        while n % i == 0:
            f.append(i)
            n //= i
    return f

def main():
    li = []
    for i in range(1, N + 1):
        li += pf(i)
    ans = 1
    for v in Counter(li).values():
        ans *= v + 1
    print(ans % 1000000007)

if __name__ == '__main__':
    main()

Solution (Python):
Data = {}

def prime_factorize(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

def addData(pflist):
    for p in pflist:
        if p in Data:
            Data[p]+=1
        else:
            Data[p]=1

MOD = 10**9+7
N = int(input())
for n in range(1,N+1):
    x = prime_factorize(n)
    addData(x)

ans = 1
for v in Data.values():
    ans *= (v+1)
    ans %= MOD
print(ans)