import math n=100000000 sn=0 for k in range(n,0,-1): sn=sn+1.0/k print "gamma(%d) = %.13f"%(n,sn-math.log(n))