Farz0l1x

Untitled

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