AlexG2230954

какой то номер из ЕГЭ

Jun 23rd, 2021 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. def get_div(num):
  2.     divs = [[q, num // q] for q in range(1, int(num ** 0.5) + 1) if num % q == 0]
  3.     divs = sum(divs, [])
  4.    
  5.     return sorted(set(divs))
  6.  
  7. a = 985_001
  8. true_nums = []
  9.  
  10. while len(true_nums) < 6:
  11.     divs = get_div(a)
  12.    
  13.     if sum(divs) % 10 == 7:
  14.         true_nums.append((a, sum(divs)))
  15.    
  16.     a += 1
  17.  
  18. for num in true_nums:
  19.     print(*num)
Add Comment
Please, Sign In to add comment