number-mania
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

Tod is very much focus about his English subject but now he is in trouble because he have to do his Math homework but also have to go for English classes so he asks you for help to solve his Math homework question.

You are given a  Natural number(N) you have to print Factorial of the Prime number present in the (S) series(1 ≤ S ≤ N)
INPUT

Natural number N ( 1 ≤ N ≤ 100)

OUTPUT

Factorial of all the prime number present in the series

Series contain all  element between (1 ≤ S ≤ N) 

SAMPLE INPUT
4

SAMPLE OUTPUT
2
6

Explanation

INPUT

4

OUTPUT

2 

6

In this problem series will be (1,2,3,4)

So, Prime number are(2,3)

Factorial of 2 (2*1)=2

Factorial of 3 (321)=6


import math
def fact(n):
	t=n
	prod =1
	while(t!=1):
		prod*=t
		t-=1
	print(prod)

n = eval(input())
for num in range(2,n+1):
	if(all(num%i!=0 for i in range(2, int(math.sqrt(num)+1)))):
		fact(num)


import math
n=eval(input())
for j in range(2,n):
	for i in range(2,j):
		if j%i==0:
			break
	else:
		print(math.factorial(j))


def prime_check(x):
	if x==2:
		return 1
	if x%2==0:
		return 0
	i=3
	while i*i<=x :
		if x%i==0 :
			return 0;
		i=i+1;
	return 1;
''' function for finding factorila '''
def factorial(x):
	if x==1 :
		return 1
	else :
		return x*(factorial(x-1))

''' main function '''
n=int(input())
i=2;
while i<=n :
	if prime_check(i) :
		print(factorial(i))
	i=i+1;




import math
a=[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]
n=int(input())
i=0
while a[i]<=n:
	print(math.factorial(a[i]))
	i+=1


import math

n = eval(input())

for i in range(2, n+1):
	prime = True
	for x in range(2, i):
		if i % x == 0:
			prime = False
			break
	if prime:
		print(math.factorial(i))


def fact(n):
	if n==0:
		 return 1
	else:
		  return n*fact(n-1)
n = eval(input())
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]
for i in range(0,25):
		if prime[i]<=n:
			print(fact(prime[i]))
		i=i+1



import math
def is_prime(n):
	if n % 2 == 0 and n > 2: 
		return False
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True
#t=int(raw_input())
#while t>0:
n=int(input())
for i in range(2,n+1):
	if(is_prime(i)):
		print(math.factorial(i))


l = [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]
f = {2:'2', 3:'6' , 5:'120', 7:'5040' ,11:'39916800', 13:'6227020800' , 17:'355687428096000', 19:'121645100408832000' , 23:'25852016738884976640000', 29:'8841761993739701954543616000000' , 31:'8222838654177922817725562880000000', 37:'13763753091226345046315979581580902400000000' , 41:'33452526613163807108170062053440751665152000000000', 43:'60415263063373835637355132068513997507264512000000000' , 47:'258623241511168180642964355153611979969197632389120000000000', 53:'4274883284060025564298013753389399649690343788366813724672000000000000' , 59: '138683118545689835737939019720389406345902876772687432540821294940160000000000000', 61:'507580213877224798800856812176625227226004528988036003099405939480985600000000000000', 67:'36471110918188685288249859096605464427167635314049524593701628500267962436943872000000000000000' , 71:'850478588567862317521167644239926010288584608120796235886430763388588680378079017697280000000000000000', 73:'4470115461512684340891257138125051110076800700282905015819080092370422104067183317016903680000000000000000' , 79:'894618213078297528685144171539831652069808216779571907213868063227837990693501860533361810841010176000000000000000000', 83:'39455239697206586511897471180120610571436503407643446275224357528369751562996629334879591940103770870906880000000000000000000', 89:'16507955160908461081216919262453619309839666236496541854913520707833171034378509739399912570787600662729080382999756800000000000000000000', 97: '96192759682482119853328425949563698712343813919172976158104477319333745612481875498805879175589072651261284189679678167647067832320000000000000000000000'}

n = int(input())
for e in l:
	if e <= n:
		print(f[e])
	


import math

a=[0]
for i in range(1,101):
	a.append(0)
i=2
a[1]=1
while(i!=101):
	if(a[i]!=0):
		i+=1
		continue
	j=2*i
	while(j<101):
		if(a[j]==0):
			a[j]=1
		j=j+i
	i+=1


#print a    
n=eval(input())
#print a
for i in range(1,n+1):
	if(a[i]==0):
		print(str(math.factorial(i)))




	


upper = int(eval(input("")))

for num in range(1,upper + 1):
	# prime numbers are greater than 1
	if num > 1:
		 for i in range(2,num):
			  if (num % i) == 0:
					break
		 else:
				
			result = 1
			for i in range(1, num + 1):
			 result = result * i
			print(result) 


import sys

def fact(n):
	index=0
	#a=[0 for i in xrange(200)]
	a=[]
	a.append(1)
	while(n>=2):
		temp=0
		i=0
		while(i<=index):
			temp=a[i]*n+temp
			a[i]=temp%10
			temp=temp/10
			i+=1
		while temp >0:
			a.append(temp%10)
			temp/=10
			index+=1
		n-=1
	number=''.join(str(e) for e in a)
	print(number[::-1])
		

prime_numbers=[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]
n=int(eval(input()))
for i in prime_numbers:
	if i<=n:
		fact(i)
	else:
		break



primes = [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]
fact = [1]
c = 1
for i in range(1,101):
	fact.append(c*i)
	c*=i


n = eval(input())
i = 0
while i<len(primes):
	if primes[i]<=n:
		print(fact[primes[i]])
	i+=1


import math

def findPrimeNumers(noRange):
	sqrt_no = int(math.sqrt(noRange))
	for no in range(2,sqrt_no+1):
		if noRange%no == 0:
			return 0

	return 1

def findFactorial(no):	
	factoril = 1;
	for no in range(1,no+1):
		factoril = factoril*no

	return factoril

enteredNumber = input()

for no in range(2,int(enteredNumber)+1):
	if no==2:
		print(2)
	else:
		check = findPrimeNumers(no)
		if check == 1:
			print(findFactorial(no))


import math
n = eval(input())
for i in range(2,n+1) :
	f = 1
	for j in range(2, int(math.sqrt(n))+1):
		if(i%j == 0 and i != j):
			 f =0
	if(f):
		print(math.factorial(i))


from sys import stdin
fa = [1]
for m in range(1,105):
	fa.append(m*fa[m-1])
n = int(stdin.readline())
a=[]
def chk(n):
	j = 2
	while j*j<=n:
		if n%j==0:
			return 0
		j+=1
	return 1
for i in range(2,n+1):
	if chk(i):
		a.append(i)
for i in a:
	print(fa[i])
		


import math
def primes(n):
	sieve = [True] * n
	for i in range(3,int(n**0.5)+1,2):
		if sieve[i]:
			sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*i)+1)
	return [2] + [i for i in range(3,n,2) if sieve[i]]

new = primes(10000000)


n = int(input())
for i in range(1,n):
	if i in new:
		print(math.factorial(i))
	else:
		pass



from math import sqrt; from itertools import count, islice

def isPrime(n):
	if n < 2: return False
	return all(n%i for i in islice(count(2), int(sqrt(n)-1)))

def factorial(n):
	if n == 0:
		return 1
	else:
		return n * factorial(n-1)
	
	
valids = {}    
for x in range(2,101):
	if isPrime(x):
		valids[x]=factorial(x)
		
ins = eval(input())
series=[]
for x in range(2,ins+1):
	if x in list(valids.keys()):
	   print(valids[x])
		
	   
		
	

	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
inpt = eval(input())
def isPrime(n):
	for i in range(2, int(n**.5)+1):
		if n % i == 0:
			return False
	return True
	
def factorial(n):
	res = 1
	for i in range(2, n+1):
		res *= i
	return res
	
for i in range(2, inpt+1):
	if isPrime(i):
		print(factorial(i))


primes=[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]
fact_primes=[2,6,]
n=int(input())
res=1
i=1
while i<=n:
	res*=i
	if i in primes:
		print(res)
	i+=1


import math
fc=math.factorial;
t=eval(input());
for j in range (2,t+1):
	f=0;
	
	for i in range (2,int(math.sqrt(j))+1):
		
		if(j%i==0):
			f=1;
			break;
	if(f==0):
		print(fc(j));