Esempio n. 1
0
def Euler_56(n=100):
    alist = [a**b for a in range(100) for b in range(100)]
    print(len(alist))
    Max = 0
    for i in range(len(alist)):
        a = maths.sumdigs(alist[i])
        if a > Max: Max = a
    return Max
Esempio n. 2
0
def Euler_56(n = 100):
    alist = [a**b for a in range(100) for b in range(100)]
    print(len(alist))
    Max = 0
    for i in range(len(alist)):
        a = maths.sumdigs(alist[i])
        if a>Max:Max = a
    return Max
Esempio n. 3
0
def e119(top=30):
    alist = []
    b = 2
    while True:
        for e in range(2, 50):
            tmp = b**e
            if sumdigs(tmp) == b: alist.append(tmp)
        if len(alist) == top + 1: return alist[top]
        b += 1
Esempio n. 4
0
def e119(top =30):
    alist = []
    b = 2
    while True:
        for e in range(2,50):
            tmp = b**e
            if sumdigs(tmp)==b:alist.append(tmp)
        if len(alist)==top+1:return alist[top]
        b+=1
Esempio n. 5
0
def Euler_20(num = 100):
    f = maths.fact(100)
    ret = maths.sumdigs(f)
    return ret