Farz0l1x

Untitled

Mar 26th, 2023
140
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.             if d % 2 == 1:
  7.                 ans.append(d)
  8.             d_b = n // d
  9.             if d != d_b and d_b % 2 == 1:
  10.                 ans.append(d_b)
  11.         d += 1
  12.     ans.sort()
  13.     return ans
  14.  
  15.  
  16.  
  17. from fnmatch import *
  18. for x in range(1302, 10**7, 217):
  19.     if fnmatch(str(x), '14?4*'):
  20.         print(x, sum(delit(x)))
Advertisement
Add Comment
Please, Sign In to add comment