Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. from math import ceil
  2.  
  3.  
  4. def has_only_four_dividers(x):
  5.     dividers = 2
  6.  
  7.     for i in range(2, ceil(x ** 0.5)):
  8.         if x % i == 0:
  9.             dividers += 2
  10.  
  11.         if dividers > 4:
  12.             return False
  13.     return True
  14.  
  15.  
  16. START = 126849
  17. END = 126871
  18.  
  19. for i in range(START, END + 1):
  20.     if has_only_four_dividers(i):
  21.         print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement