Farz0l1x

Untitled

Mar 26th, 2023
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. def delit(n):
  2.     ans = []
  3.     d = 1
  4.     while d * d <= n:
  5.         if n % d == 0:
  6.             ans.append(d)
  7.             d_b = n // d
  8.             if d != d_b and d_b % 2 == 0:
  9.                 ans.append(d_b)
  10.         d += 1
  11.     ans.sort()
  12.     return ans
  13.  
  14.  
  15.  
  16. from fnmatch import *
  17. for x in range(0, 10**6):
  18.     if fnmatch(str(x), '?6*6*?6') and x % 6 == 0 and x % 7 == 0 and x % 8 == 0:
  19.         print(x, sum(delit(x)))
Advertisement
Add Comment
Please, Sign In to add comment