Advertisement
Guest User

Untitled

a guest
Sep 7th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def fact(x):
  2.     sum = 1
  3.     res = 0
  4.     if x == 1:
  5.         return 1
  6.     if x == 0:
  7.         return 0
  8.  
  9.     for i in reversed(range(1, x + 1)):
  10.  
  11.         sum *= i
  12.  
  13.     return sum
  14.  
  15.  
  16. def func_fact(n):
  17.     for i in range(13, 501):
  18.         if fact(i) % n == 0:
  19.             print(i)
  20.             return i
  21.  
  22.     return 0
  23.  
  24. def sigma(M, N):
  25.  
  26.     print(sum(list(map(lambda i: func_fact(i), range(M, N + 1)))))
  27.  
  28.  
  29. sigma(600000000, 610000000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement