def arec(top): ret = 0 if top==0:return e-1 for n in range(1,top+1): ret+=arec(top-n)/fact(n) ret+=(e-1)-sum([1/fact(i) for i in range(1,top+1)]) return ret
def a(n): if n==0:return e-1 if n==1:return 2*e-3 if n==2:return 7/2*e-6 if n<0:return 1 x = 0 i = 1 while True: lastx,x = x,x+a(n-i)/fact(i) i+=1 if lastx==x:return x
def Euler_20(num = 100): f = maths.fact(100) ret = maths.sumdigs(f) return ret
def e020(num=100): return sum([int(i) for i in str(fact(num))])
def test(): for i in range(100,9101,100): print(i/9100,end='\r') x = abi(i) return abi(9100)+(-2*abi(9100)+fact(9100))
def Bval(n): return fact(n)-2*A(n)
def B1(n): return round(fact(n)-2*D(n))
def D(n): if n<0:return 0 return round((fact(n)*b(n))/(e-2))
def bbi(n,a = 0): if a: return fact(n)-2*a else: return fact(n)-2*abi(n)
def abi(n): ret = fact(n) for i in range(n): ret+=bc(n,i)*abi(i) return ret
def Euler_15(i=20,j=20): ret = maths.fact(i+j)//maths.fact(i)//maths.fact(j)#binomial coefficients return ret
def Euler_15(i=20, j=20): ret = maths.fact(i + j) // maths.fact(i) // maths.fact( j) #binomial coefficients return ret