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())
div=1000000007

primelist=list(range(2,N+1))

for i in range(2,N+1):
        j=2
        while i*j<=N:
                if i*j in primelist:
                        primelist.remove(i*j)
                j+=1

primecntdict={p:0 for p in primelist}

for n in range(2,N+1):
        for p in [p for p in primelist if p <= n]:
                while n%p==0:
                        n/=p
                        primecntdict[p]+=1

res=1
for p in primelist:
        res*=primecntdict[p]+1
        res%=div

print(res)

Solution (Python):
import math
N = int(raw_input())
count = [0 for i in xrange(N)]
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

for n in xrange(2,N+1):
  table = prime_decomposition(n)
  for t in table:
    count[t-2]+=1

C = 1
for c in count:
  if c!=0:
    C*=(c+1)
print C%1000000007

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

    primes = sieve(N+1)
    res = 1
    for p in primes:
        f = 0
        i = 1
        while p ** i <= N:
            f += (N//(p**i))
            i += 1
        res *= f + 1
        res = res % (10**9 + 7)

    print(res)

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i > 1]

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

if __name__ == "__main__":
    main()

Solution (Python):
import math

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff


def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(raw_input())

s = math.factorial(N)
x = divisor_num(s)
z = 1000000007

if x > z:
    ans = x%z
else:
    ans = x


print ans

Solution (Python):
import functools
import sys
import math
from functools import reduce

input = lambda :sys.stdin.readline()
@functools.lru_cache(maxsize=10000)

def prime_numbers(limit=50001):
    yield 2
    sub_limit = int(limit**0.5)
    flags = [True, True] + [False] * (limit - 2)
    for i in range(3, limit, 2):
        if flags[i]:
            continue
        yield i

        if i <= sub_limit:
            for j in range(i*i, limit, i<<1):
                flags[j] = True

p=list(prime_numbers())


n=int(input())
d=[]
pr=1
for num in p:
    if num<=n:
        exp=1
        s=0
        while n>=num**exp:
            s+=int(n/(num**exp))
            exp+=1
        pr*=(s+1)
        
    else:
        break
print (pr%1000000007)

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

primedict= {i:True for i in range(2,N+1)}

for i in range(2,N+1):
        if primedict[i]==True:
                j=2
                while i*j<=N:
                        primedict[i*j]=False
                        j+=1

primelist = [i for i in  range(2,N+1) if primedict[i]==True]

primecntdict={p:0 for p in primelist}

for n in range(2,N+1):
        for p in [p for p in primelist if p <= n]:
                while n%p==0:
                        n/=p
                        primecntdict[p]+=1

res=1
for p in primelist:
        res*=primecntdict[p]+1
        res%=div

print(res)

Solution (Python):
from collections import Counter
def primes(n):
    pp = [True] * (n+1000)
    pp[0] = False
    pp[1] = False

    for i in range(2,n+1000):
        if pp[i]:
            for j in range(2,(n+1000)//i):
                pp[i*j] = False
    result = [i for i in range(n+1) if pp[i]]
    return result



if __name__=="__main__":
    N= int(input())

    pr = primes(N)
    counter = Counter()
    for p in pr:
        x = p
        while x <= N:
            counter[p] += N//x
            x *= p
    result = 1
    for x in counter.values():
        result = (result * (x+1)) % 1000000007
    print(result)

Solution (Python):
import sys
import math

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

factor = {}

for n in range(2, N + 1):
    p = 2
    root_n = math.sqrt(n)

    while n > 1 and p <= root_n:
        if n % p == 0:
            if p not in factor:
                factor[p] = 0

            while n % p == 0:
                n //= p
                factor[p] += 1

        p += 1

    if n > 1:
        if n not in factor:
            factor[n] = 1
        else:
            factor[n] += 1



ans = 1

for v in factor.values():
    ans *= (v + 1)

ans %= M

print(ans)

Solution (Python):
def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):

        if (prime[p] == True):

            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    lis = []
    for i in range(2,n+1):
        if prime[i]:
            lis.append(i)
    return lis

n = int(input())

lis1 = []

l = SieveOfEratosthenes(n)

for i in l:
    m = n
    z = i
    exp = 0
    while(m>=z):
        exp += m//z
        z*=i
    lis1.append(exp)

mul = 1
for i in lis1:
    mul *= (i+1)

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

Solution (Python):
def dict_count(dict, key):
	if key in dict:
		dict[key] = dict[key]+1
	else:
		dict[key] = 1
	return dict

N = int(input())
divs = {}
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
for n in range(2, N+1):
	for p in primes:
		while n%p==0:
			divs = dict_count(divs, p)
			n = n//p
		if p*p>n:
			break
	if n!=1:
		dict_count(divs, n)
result = 1
base = 10**9+7
for c in divs.values():
	result = (result*(c+1))%base
print(result)

Solution (Python):
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
N = input()
ans = 1
nlist = [0]*1000
for i in xrange(1,N+1):
    for j in prime_decomposition(i):
        nlist[j-1] += 1

for j in nlist:
    ans *= (j+1)

print ans%1000000007

Solution (Python):



def read():
    return input()


def work(N):
    divisor2cnt = {}
    for i in range(1, N + 1):
        num = i
        divisor = 2
        
        while divisor * divisor <= num:
            while num % divisor == 0:
                num /= divisor
                if divisor not in divisor2cnt:
                    divisor2cnt[divisor] = 1
                else:
                    divisor2cnt[divisor] = divisor2cnt[divisor] + 1
            divisor += 1
        
        if num != 1:
            if num not in divisor2cnt:
                divisor2cnt[num] = 1
            else:
                divisor2cnt[num] = divisor2cnt[num] + 1

    ans = 1
    for (divisor, cnt) in divisor2cnt.items():
        ans = ans * (cnt + 1) % 1000000007
    print ans


if __name__ == "__main__":
    work(read())