Advertisement
Ser1ousSAM

25

Apr 20th, 2021
1,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. div_first=0
  2. div_second=0
  3. def devisiors(i):
  4.     count = 0
  5.     step = 0
  6.     for j in range(1, int(i ** 0.5)):
  7.         if i % j == 0:
  8.             count += 1
  9.             if step == 0:
  10.                 global div_first
  11.                 div_first = i // j
  12.             if step == 1:
  13.                 global div_second
  14.                 div_second = i // j
  15.         step += 1
  16.     count *= 2
  17.     return count
  18. max_divs = 0
  19. div_f=0
  20. div_s=0
  21. for i in range(286564, 287270 + 1):
  22.     val = devisiors(i)
  23.     if max_divs <= val:
  24.         max_divs = val
  25.         div_f=div_first
  26.         div_s=div_second
  27. print(max_divs, div_f, div_s)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement