Пример #1
0
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
Пример #2
0
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
Пример #3
0
def Euler_20(num = 100):
    f = maths.fact(100)
    ret = maths.sumdigs(f)
    return ret
Пример #4
0
def e020(num=100):
    return sum([int(i) for i in str(fact(num))])
Пример #5
0
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))
Пример #6
0
def Bval(n):
    return fact(n)-2*A(n)
Пример #7
0
def B1(n):
    return round(fact(n)-2*D(n))
Пример #8
0
def D(n):
    if n<0:return 0
    return round((fact(n)*b(n))/(e-2))
Пример #9
0
def bbi(n,a = 0):
    if a:
        return fact(n)-2*a
    else:
        return fact(n)-2*abi(n)
Пример #10
0
def abi(n):
    ret = fact(n)
    for i in range(n):
        ret+=bc(n,i)*abi(i)
    return ret
Пример #11
0
def Euler_15(i=20,j=20):
    ret = maths.fact(i+j)//maths.fact(i)//maths.fact(j)#binomial coefficients
    return ret
Пример #12
0
def Euler_15(i=20, j=20):
    ret = maths.fact(i + j) // maths.fact(i) // maths.fact(
        j)  #binomial coefficients
    return ret