Advertisement
Korobka887

Untitled

Jan 31st, 2022 (edited)
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. from math import sqrt
  2.  
  3. def five_divs(n):
  4.     count_divs = 1
  5.  
  6.     for div in range(2, int(sqrt(n)) + 1):
  7.         if n % div == 0:
  8.             count_divs += 1 if div % 2 == 0 else 0
  9.             count_divs += 1 if (n // div) % 2 == 0 and n // div != div else 0
  10.             if count_divs > 5:
  11.                 break
  12.  
  13.     return True if count_divs == 5 else False
  14.  
  15.  
  16. for n in range(1000000, 2000001, 2):
  17.     if five_divs(n):
  18.         print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement