Example #1
0
def main():
    x,y = 1,e[0]
    x += y*e[1]
    for i in e[2:]:
        x,y = y,x
        x += y*i
    x,y = y,x
    x += 2*y
    print sum_of_digits(x)
Example #2
0
def main():
    total = 0
    for i in range(1,101):
        num = str(Decimal(i).sqrt())[:-5].replace(".","")
        if len(num) == 100:
            total += sum_of_digits(int(num))
    print total
Example #3
0
def main():
    s = util.sum_of_digits(2**1000)
    print "The sum of the digits of the number 2**1000 is: %d" % (s,)
Example #4
0
def main():
    sum_of_digits = util.sum_of_digits(math.factorial(100))
    print "The sum of the digits in 100! is %d." % (sum_of_digits,)