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):
def main():
    N = int(input())
    MOD = 10**9 + 7
    ans = 1
    primes = sorted(Eratosthenes(N))
    for p in primes:
        cur = 0
        k = 1
        while p**k <= N:
            cur += N//(p**k)
            k += 1
        ans = ans * (cur+1) % MOD
    print(ans%MOD)

def Eratosthenes(x: int) -> set:
    """x以下の素数のsetを返す"""
    import math
    sup = int(x)
    primes = {i for i in range(2,sup+1)}
    for i in range(2,int(math.sqrt(sup+1))+1):
        if i in primes:
            mul = 2
            while i*mul <= sup:
                primes.discard(i*mul)
                mul += 1
    return primes

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
from collections import Counter
N = int(stdin.readline().rstrip())
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
fact = Counter()
for i in range(1,N+1):
    fact += Counter(prime_factorize(i))
ans = 1
for j in fact.values():
    ans = ans * (j+1)
print(ans%mod)

Solution (Python):
def isp(n):
  for i in range(2, int(n**(1/2))+1):
    if n % i == 0:
      return False
  return True    

N = int(input())
prime = []
ans = 1
mod = 10 ** 9 + 7

for i in range(2, N+1):
  if isp(i):
    prime.append(i)
A = [1] * len(prime)

for i in range(2, N+1):
  n = i
  for j in range(len(prime)):
    p = prime[j]
    while n % p == 0:
      n = n//p
      A[j] += 1
for a in A:
  ans = ans * a % mod

print(ans)

Solution (Python):
n = int(input())
m=10**9+7
p=[]
for k in range(2,n+1):
  f=1
  for i in p:
    if k%i==0:
      f=0
      break
  if f==1:
    p+=[k]
l=[1]*len(p)
for i in range(len(p)):
  d=p[i]
  x=n//d
  while x>0:
    l[i]+=x
    x//=d
a=1
for i in l:
  a*=i
  a%=m
print(a)

Solution (Python):
from collections import Counter
N = int(input())

INF = 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 = Counter({})
for i in range(1, N+1):
  c += Counter(prime_factorize(i))

ans = 1
for i in c.values():
  ans = (ans * (i + 1)) % INF
print(ans)

Solution (Python):
from math import factorial as fact
ans = 1
n = int(input())
m = fact(n)
for i in range(2, n+1):
    tmp = 1
    while m%i==0:
        m //= i
        tmp += 1
    ans *= tmp
print(ans%(10**9+7))

Solution (Python):
import math

N = int(input())

MOD = 10 ** 9 + 7





def eratosthenes(n):
    
    
    is_prime = [True] * (n + 1)

    
    is_prime[0] = False
    is_prime[1] = False

    
    
    
    for i in range(2, int(math.sqrt(n))+1):
        
        
        if not is_prime[i]:
            continue
        
        
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    
    return [i for i in range(n + 1) if is_prime[i]]

prime = eratosthenes(N)

M = len(prime)
cnt = [0]*M
for i in range(M):
    p = prime[i]
    while p <= N:
        cnt[i] += N // p
        p *= prime[i]

ans = 1
for i in range(M):
    ans *= cnt[i] + 1
    ans %= MOD
print(ans)

Solution (Python):

import math

N = int(input())

MOD = 10 ** 9 + 7


def check_prime(n):
    flag = True

    
    
    if (n % 2 == 0 and n != 2) or n == 0 or n == 1:
        flag = False
        return(flag)

    
    else:
        
        for i in range(2, math.floor(math.sqrt(n))+1):
            if n % i == 0:
                flag = False
                break
        return(flag)


prime = []
for i in range(N+1):
    if check_prime(i):
        prime.append(i)

M = len(prime)
cnt = [0]*M
for i in range(M):
    p = prime[i]
    while p <= N:
        cnt[i] += N // p
        p *= prime[i]

ans = 1
for i in range(M):
    ans *= cnt[i] + 1
    ans %= MOD
print(ans)

Solution (Python):
import math

N = int(input())

MOD = 10 ** 9 + 7


def check_prime(n):
    flag = True

    
    
    if (n % 2 == 0 and n != 2) or n == 0 or n == 1:
        flag = False
        return(flag)

    
    else:
        
        for i in range(2, math.floor(math.sqrt(n))+1):
            if n % i == 0:
                flag = False
                break
        return(flag)


prime = []
for i in range(N+1):
    if check_prime(i):
        prime.append(i)

M = len(prime)
cnt = [0]*M 
for i in range(1, N+1):
    for j in range(M):
        p = prime[j]
        if p > i:
            break
        else:
            while i % p == 0:
                i //= p
                cnt[j] += 1

ans = 1
for i in range(M):
    ans *= cnt[i] + 1
    ans %= MOD
print(ans)

Solution (Python):
import math


def __sieve(num):
    sieved_set = set()
    for i in range(2, num + 1):
        sieved_set.add(i)

    
    for i in range(2, int(math.sqrt(num)) + 1):
        for j in range(2, num + 1):
            if (j % i == 0) and (j != i) and (j in sieved_set):
                sieved_set.remove(j)

    return sieved_set


def __calc_divisor(num, prime_count_array):
    for prime in prime_count_array:
        count = 0
        temp_divided = num
        while temp_divided % prime == 0:
            count += 1
            temp_divided /= prime
        prime_count_array[prime] += count


n = int(input())


primes = __sieve(n)


prime_count_array = {}
for i in primes:
    prime_count_array[i] = 0
for i in range(2, n + 1):
    __calc_divisor(i, prime_count_array)


divisor_count = 1
for divisor_count_of_prime in prime_count_array.values():
    divisor_count *= (divisor_count_of_prime + 1)


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

Solution (Python):
import math
num=int(input())
n=math.factorial(num)
prime="2　3　5　7　11　13　17　19　23　29　31　37　41　43　47　53　59　61　67　71　73　79　83　89　97　101　103　107　109　113　127　131　137　139　149　151　157　163　167　173　179　181　191　193　197　199　211　223　227　229　233　239　241　251　257　263　269　271　277　281　283　293　307　311　313　317　331　337　347　349　353　359　367　373　379　383　389　397　401　409　419　421　431　433　439　443　449　457　461　463　467　479　487　491　499　503　509　521　523　541　547　557　563　569　571　577　587　593　599　601　607　613　617　619　631　641　643　647　653　659　661　673　677　683　691　701　709　719　727　733　739　743　751　757　761　769　773　787　797　809　811　821　823　827　829　839　853　857　859　863　877　881　883　887　907　911　919　929　937　941　947　953　967　971　977　983　991 997"
primes=prime.split()
dictionary={}

order=0
k=0
for som in primes:
    some=int(som)
    while n%some**k==0:
            k+=1 
    dictionary[som]=k-1
    k=0
ans=1
for i, v in dictionary.items():
    ans*=(v+1)
    ans=ans%(10**9+7)
print(ans)

Solution (Python):
import math
import collections
import sys
sys.setrecursionlimit(500000)

def f(n,i):
    while i * i <= n:
        if n % i == 0:
            a.append(i)
            n //= i
        else:i += 1
    if n != 1:
        a.append(n)
    return a

a = []
n = math.factorial(int(input()))
c = collections.Counter(f(n,2))
d = [i[1]+1 for i in c.items()]
ans = 1
for i in range(len(d)):
    ans = (ans * d[i]) % 1000000007
print(ans)

Solution (Python):
import math
import collections
def f(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(f(math.factorial((int(input())))))
d = [i[1]+1 for i in c.items()]
ans = 1
for i in range(len(d)):
    ans = (ans * d[i]) % 1000000007
print(ans)

Solution (Python):
import collections

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

N = int(input())
ans, temp = 1, [0] * (N+1)
for i in range(2, N+1):
    c = prime_factorize(i)
    divs, exps = list(c.keys()), list(c.values())
    for j in range(len(divs)):
        temp[divs[j]] += exps[j]

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

Solution (Python):
import math
import collections

N = int(input())
n = math.factorial(N)
a = []
ans = 1
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)
a = collections.Counter(a)
for i in a.values():
    ans *= (i + 1)
print(ans % 1000000007)

Solution (Python):
n=int(input());a=1;r=range
for x in[i for i in r(2,n+1)if all(i%j for j in r(2,i))]:a*=sum(n//x**i for i in r(1,11))+1
print(a%(10**9+7))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



def sieve(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


n = I()
primes = sieve(n)
prime_num = len(primes)
L = prime_num * [0]
for i in range(prime_num):
    ret = primes[i]
    while ret <= n:
        L[i] += n // ret
        ret *= primes[i]


ans = 1
for j in range(prime_num):
    ans = ans * (L[j] + 1) % mod



print(ans)

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

def divisor(N, div):
    if N==0 or N==1:
        return div
    n=N
    for i in range(2, int(N**0.5)+1):
        if n%i==0:
            cnt=0
            while n%i==0:
                cnt+=1
                n//=i
            try:
                div[i]+=cnt
            except:
                div[i]=cnt
    if n!=1:
        try:
            div[n]+=1
        except:
            div[n]=1
    return div

def fact(n):
    div={}
    for i in range(1, n+1):
        div=divisor(i, div)
    return div

d=fact(n)
mod=10**9+7
ans=1
for k,v in d.items():
    ans*=(v+1)
    ans%=mod
print(ans)

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

for i in range(2, n+1):
  tmp = i
  div = 2
  while tmp > 1:
    if tmp % div == 0:
      if div not in d:
        d[div] = 1
      else:
        d[div] += 1
      tmp //= div
    else:
      div += 1

ans = 1
for div in d:
  ans = ans * (d[div] + 1) % m

print(ans)

Solution (Python):
mod = 1000000007

N = int(input())

dic = {}
for i in range(1,N+1):
  tmp = i
  k = 2
  while tmp != 1:
    if tmp%k == 0:
      if k in dic:
        dic[k] += 1
      else:
        dic[k] = 1
      tmp //= k
      k = 2
    else:
      k += 1

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

print(ans)

Solution (Python):

import sys
from collections import deque, defaultdict
import copy
import bisect

import math
import heapq
from itertools import product, permutations,combinations
import fractions

import sys
def input():
	return sys.stdin.readline().strip()


def soinsu_bunkai(n):
	ans = []
	num = n
	i = 2
	while i <= n**0.5:
		if num % i == 0:
			if len(ans) == 0 or ans[-1][0] != i:
				ans.append([i, 1])
			else:
				ans[-1][1] += 1
			num = num//i
		else:
			i+=1
	if num != 1:
		ans.append([num, 1])

	return ans

N = int(input())

soinsu_list = defaultdict(int)
for i in range(2, N + 1):
	soinsu = soinsu_bunkai(i)
	for x in soinsu:
		soinsu_list[x[0]] += x[1]


ans = 1
for i in soinsu_list:
	ans *= soinsu_list[i] + 1
	ans = ans % 1000000007

print(ans)

Solution (Python):
n=int(input())
P=[2]
for i in range(3,n+1,2):
  for j in range(3,int(i**0.5+1)):
    if i%j==0:
      break
  else:P.append(i)
p=[1]*len(P)
for i in range(1,n+1):
  for j in range(len(P)):
    x=i
    c=0
    while(x%P[j]==0):
      x//=P[j]
      c+=1
    p[j]+=c
a=1
for x in p:
  a*=x
print(a%(10**9+7))

Solution (Python):
n = int(input())
mod = 10**9 + 7
ans = 1
L = [0] * (n+1)
for i in range(2, n+1):
    f = i
    for j in range(2, i+1):
        while f != 1 and f % j == 0:
            f //= j
            L[j] += 1



for i in range(2, len(L)):
    if L[i] > 0:
        ans = (ans * (L[i]+1)) % mod
print(ans)

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

N = int(input())
P = [0]*(N+1)
ans = 1
mod = 10**9+7
for i in range(2,N+1):
    a = prime_factor(i)
    for j in a:
        P[j] += 1
for k in P:
    ans = ans*(k+1)%mod
print(ans)

Solution (Python):

import math
import collections

n = input()


N = math.factorial(int(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

a = prime_factorize(N)


c = collections.Counter(a)


d = list(c.values())


e = 1
for i in range(len(d)):
    e = e*(d[i]+1)


print(e % 1000000007)

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

def div(m):
  d = {}
  temp = int(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m //= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  else:
    if m in d:
      d[m] += 1
    elif m != 1:
      d[m] =1
  return d

from collections import Counter

d = {}
for i in range(2, n+1):
  d = dict(Counter(d)+Counter(div(i)))

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

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

def div(m):
  d = {}
  temp = int(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m //= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  else:
    if m in d:
      d[m] += 1
    elif m != 1:
      d[m] =1
  return d

from collections import Counter

d = {}
for i in range(2, n+1):
  d = dict(Counter(d)+Counter(div(i)))

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

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    N = int(input())

    MOD = int(1e9) + 7

    MAX_PRIME = N
    primes = []
    is_prime = [True] * (MAX_PRIME+1)
    for i in range(2, MAX_PRIME+1):
        if is_prime[i]:
            primes.append(i)
            for j in range(2*i, MAX_PRIME+1, i):
                is_prime[j] = False
    
    count = [0] * len(primes)
    for i in range(2, N+1):
        tmp = i
        for j in range(len(primes)):
            while tmp%primes[j] == 0:
                count[j] += 1
                tmp //= primes[j]
    
    ans = 1
    for c in count:
        if c > 0:
            ans *= c+1
            ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

import sys


MOD = 1000000007  

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 solve(N: int):
    from functools import reduce
    from operator import mul

    nn = reduce(mul, range(1,N+1))
    from collections import defaultdict
    

    d = defaultdict(int)
    for i in range(2, N+1):
        t = prime_factorize(i)        

        for j in t:
            d[j] += 1

    ans = 1
    for i,v in d.items():
        if(i == 1): continue
        ans *= (v+1)

    print(ans%MOD)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
MOD = 1000000007
N = int(input())
d = dict()

for i in range(2, N+1):
    tmp = i
    div = 2
    while tmp > 1:
        if tmp % div == 0:
            if div not in d:
                d[div] = 1
            else:
                d[div] = d[div] + 1
            tmp = tmp // div
        else:
            div += 1
ans = 1
for div in d:
    ans = ans * (d[div] + 1) % MOD

print(ans)

Solution (Python):
import math

N = int(input())

flg = [1 for _ in range(1001)]
flg[0] = 0
flg[1] = 0


def judge(n):
	tmp = math.floor(n**(1/2))
	for i in range(2,tmp+1):
		if n % i == 0:
			return False
	return True


for i in range(2,1001):
	if flg[i] == 0:
		continue

	if judge(i):
		for j in range(2, 1000//i + 1):
			flg[i*j] = 0

sosu = [i for i in range(1001) if flg[i] == 1]



cnt = [0 for _ in range(N+1)]

def SB(n):
	t = n
	i = 0
	while t != 1:
		tmp_cnt = 0
		while t % sosu[i] == 0:
			t //= sosu[i]
			tmp_cnt += 1
		cnt[sosu[i]] += tmp_cnt
		i += 1
		tmp_cnt = 0


for i in range(2,N+1):
	SB(i)

ans_l = [cnt[i] for i in range(N+1) if cnt[i] != 0]

ans = 1
for i in range(len(ans_l)):
	ans *= (ans_l[i]+1)
	ans %= 1000000007

print(ans)

Solution (Python):

import math
import collections

N = int(input().split()[0])

def factorize(n: int) -> list:
    
    f_list = []
    while n % 2 == 0:
        f_list.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            f_list.append(f)
            n //= f
        else:
            
            f += 2

    if n != 1:
        f_list.append(n)
    return f_list

mod = 10**9 + 7
c = 1
d_list = []
counter = collections.Counter()

for i in range(1, N+1):
    f_list = factorize(i)
    c = collections.Counter(f_list)
    counter += c

x = 1

for k, v in counter.items():
    x *= (v + 1) % mod

ans = x % mod
print(ans)

Solution (Python):
N = int(input())
mod = 10 ** 9 + 7 
f = 1
res = 1
for i in range(2, N + 1): f *= i
for i in range(2, N + 1):
  c = 0
  while f % i == 0:
    c += 1
    f //= i
  res *= (c + 1) % mod
  res %= mod
print(res % mod)

Solution (Python):
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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

n = inp()
x = 1
ans = 1
for i in range(1,n+1):
    x *= i
cnt = Counter(prime_factorize(x))

for value in cnt.values():
    ans *= (value+1)
print(ans%mod)

Solution (Python):
def soinsuu(n):
    ans = [0 for _ in range(n+1)]
    while n>1:
        for i in range(2,n+1):
            if n % i==0:
                ans[i] += 1
                n = n//i
                break
    return ans

N = int(input())

sosuu_cnt_list = [0 for _ in range(N+1)]
for i in range(1,N+1):
    tmp_sosuu_cnt = soinsuu(i)
    for sss,cnt in enumerate(tmp_sosuu_cnt):
        sosuu_cnt_list[sss] += cnt

cnt = 1
for sosuu_cnt in sosuu_cnt_list:
    if sosuu_cnt !=0:
        cnt *= sosuu_cnt+1
        cnt %= 10**9+7



print(cnt)

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

for i in range(2, N + 1):
    p *= i
ans = 1

for i in range(2, N + 1):
    if p % i != 0:
        continue
    c = 1
    while p % i == 0:
        p //= i
        c += 1
    ans *= c
print(ans % 1000000007)

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


def generate_primes(n):
    """Returns list of primes <= n."""
    from math import sqrt
    isprime = [True] * n
    isprime[0] = False
    for i in range(2, 1+round(sqrt(n))):
        if not isprime[i-1]:
            continue
        for j in range(2, 1 + n // i):
            isprime[i*j-1] = False
    p = [i+1 for i, v in enumerate(isprime) if v]
    return p


def fact_in_primes(n, primes):
    """primes must be sorted."""
    
    from collections import Counter
    c = Counter()
    for p in primes:
        if n < p:
            break
        while n % p == 0:
            n //= p
            c[p] += 1
    assert n == 1
    return c


N = int(input())
primes = generate_primes(N)
c = sum([fact_in_primes(n, primes) for n in range(2, N + 1)], Counter())
ans = reduce(mul, [n + 1 for n in c.values()], 1) % 1000000007
print(ans)

Solution (Python):
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

N=int(input())
A=[0]*1000
total=1
for i in range(1,N+1):
    for j in range(len(factorize(i))):
        A[factorize(i)[j]]+=1

for i in range(2,1000):
    if A[i]>=1:
        total*=(A[i]+1)

print(total%1000000007)

Solution (Python):
N=int(input())
l=[]
for i in range(2,N+1):
    for j in l:
        if i%j==0:
            break
    else:
        l.append(i)
a=1
for i in l:
    t=0
    s=1
    while i**s<=N:
        t+=N//i**s
        s+=1
    a=a*(t+1)%(10**9+7)
print(a)

Solution (Python):
import sys
import copy
import string
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table


mod = 10 ** 9 + 7
d = [0] * (10 ** 3 + 1)
n = ni()
for i in range(1, n+1):
    for pn in prime_decomposition(i):
        d[pn] += 1
ans = 1
for i in range(1, len(d)):
    if d[i] != 0:
        ans *= (d[i] + 1)
        ans %= mod
print(ans)

Solution (Python):
import collections

n = int(input())

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 = {}

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

    c = collections.Counter(prime_factorize(i))
    keys = list(c.keys())
    values = list(c.values())
    for i in range(len(keys)):
        if keys[i] in li:
            li[keys[i]] += values[i]
        else:
            li[keys[i]] = values[i]

ans = list(li.values())
ans = [i+1 for i in ans]

count = 1
mod = (10**9) + 7
for i in ans:
    count = count * i % mod
print(count)

Solution (Python):
import sys
sys.setrecursionlimit(100000000)
n = int(input())
def factrial(n):
    if n == 1:
        return 1
    return n * factrial(n-1)
def primes(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
prime = primes(n)
fact = factrial(n)
ans = []
for i in prime:
    tmp = 0
    for j in range(1, 1000):
        ij = i**j
        if tmp > n:
            break
        tmp += n//ij
    ans.append(tmp + 1)
answer = 1
for i in ans:
    answer *= i
print(answer%(10**9+7))

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

d = defaultdict(int)
for m in range(2, n+1):
    while m % 2 == 0:
        d[2] += 1
        m = m // 2

    p = 3
    while m > 1:
        while m % p == 0:
            d[p] += 1
            m = m // p
        p += 2

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

print(ans)

Solution (Python):
import sys
input=sys.stdin.readline
n=int(input())
INF=10**9+7
Num=[0]*(n+1)
for x in range(2,n+1):
    i=2
    while i*2<=x:
        while x%i==0:
            x=x//i
            Num[i]+=1
        i=i+1
    if not x==1:
        Num[x]+=1
ans=1
for i in Num:
    ans=(ans*(i+1))%INF
print(ans)

Solution (Python):
from collections import deque
N = int(input())
div = {}
def dividers(n):
  global div
  i = 2
  while n != i:
    if n % i == 0:
      div[i] = div.setdefault(i, 0) + 1
      n //= i
      i = 2
    else:
      i += 1
  else:
    div[i] = div.setdefault(i, 0) + 1

for n in range(2, N + 1):
  dividers(n)

def f(L):
  ret = 1
  for l in L.values():
    ret *= (l + 1)
  return ret

print(f(div) % (10 ** 9 + 7))

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

mod = 10**9+7

sosu = [1] * 1001

for j in range(2,n+1):
    tmp = j
    i = 2
    while tmp > 1:
        if tmp % i == 0:
            sosu[i] += 1
            tmp = tmp // i
        else:
            i += 1
        

sosu.sort(reverse=True)

ans = 1

for i in range(len(sosu)):
    if sosu[i] > 1:
        ans = ans*sosu[i] % mod
        
print(ans)

Solution (Python):
n=int(input())
p_list=[2]
for i in range(3,1000):
  for p in p_list:
    if i%p==0:
      break
  else:
    p_list.append(i)

p_kosu=[0,0]
for i in range(1,10):
  p_kosu[0]+=n//(2**i)
  p_kosu[1]+=n//(3**i)
for p in p_list:
  if p==2 or p==3:
    continue
  if p>n:
    break
  kosu=n//p
  if p**2>n:
    p_kosu.append(kosu)
    continue
  kosu+=n//(p**2)
  if p**3>n:
    p_kosu.append(kosu)
    continue
  kosu+=n//(p**3)
  if p**4>n:
    p_kosu.append(kosu)
    continue
  kosu+=n//(p**4)
  p_kosu.append(kosu)
ans=1
for i in p_kosu:
  ans=ans*(i+1)%1000000007
print(ans)

Solution (Python):
from collections import Counter
N = int(input().strip())

def make_prime_list(N):
  prime_list = [2,3]
  for i in range(5, N+1):
    flag = True
    for p in prime_list:
      if i % p == 0:
        flag = False
        break
    if flag:
      prime_list.append(i)
    
  return prime_list

prime_list = make_prime_list(N)
  
def prime_factorization(n, prime_list):
  result = []
  for p in prime_list:
    while True:
      if n % p == 0:
        result.append(p)
        n = n//p
      else:
        break
  return result
  
all_counter = Counter()
for i in range(2,N+1):
  all_counter += Counter(prime_factorization(i, prime_list))

ans = 1
for k in all_counter.keys():
  ans *= all_counter[k]+1
  
print(ans%1000000007)

Solution (Python):
import math
import collections

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 n == 1:
        return factor
    if not factor:
        return [n]
    else:
        factor.append(n)
        return factor

n = int(input())
kai = [0 for _ in range(n+1)]
MOD = 10**9 + 7
l = []

for i in range(1, n+1):
    l.extend(trial_division(i))
c = collections.Counter(l)

s = 1
for key, value in c.items():
    s *= (value + 1)
    s %= MOD

print(s)

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

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
dic = defaultdict(int)
x = 1
for n in range(1, N+1):
	for i in factorization(n):
		if i[0] == 1:
			continue
		dic[i[0]] += i[1]
for val in dic:
	x = (x * (dic[val]+1))%MOD

print(x)

Solution (Python):
import math
def main():
    N = int(input())
    div = pow(10, 9) + 7

    if N == 1: return 1
    primes = primes1000()
    d = dict()
    for i in range(2, N+1):
        j = i
        for p in primes:
            if p > j:
                break
            else:
                while j % p == 0:
                    j = j // p
                    d[p] = d.get(p, 0) + 1

    
    ans = 1
    for p in d:
        ans *= (d[p] + 1)
    return ans % div


def primes1000():
    pms = []
    for i in range(2, 1000+1):
        isPrime = True
        for j in range(2, int(math.sqrt(i))+1):
            if i % j == 0:
                isPrime = False
                break
        if isPrime:
            pms.append(i)
    return pms



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

Solution (Python):
def pfn(N):
    factor=[]
    N=int(N)
    if N==1:
        return []
    else:
        for num in range(2, N+1):
            while N % num==0:
                N //=num
                factor.append(num)
        return factor
            
N=int(input())
factor=[]
for i in range(1, N+1):
    factor+=pfn(i)
    
p=1
factor_set=list(set(factor))
for x in factor_set:
    p*=factor.count(x)+1
    
print(p%(10**9+7))