import sys import time def primes(n): if n < 2: return 0 if n==2: return 1 for x in range(2,int(n**0.5)+1): if n % x == 0: return 0 return 1 def fact(n): fac=1 for g in range(1,n+1): fac=fac*g return fac def a(): f0=open("c:\inputs\in2_6.txt","r") f1=open("out_3_sec2_6.txt","a") n=int(f0.readline()) start=time.clock() m=2 a=1 b=1 p=1 sh=[] add=0 while(p<=n): m=m+1 c=a+b add=add+2 a=b b=c f=primes(c) if(f==1): sh.append(m) p=p+1 list=[] for i in range (0,len(sh)): list=fact(sh[i]) f1.write(str(list)+"\n") el=time.clock()-start total=sys.getsizeof(list)+sys.getsizeof(el)+sys.getsizeof(sh)+sys.getsizeof(c)+sys.getsizeof(b)+sys.getsizeof(a)+sys.getsizeof(f) f1.write("\n"+str("time ")+str(el)+"\n"+str("addition ")+str(add)+"\n"+str("memory ")+str(total)) f0.close() f1.close() a()