Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import math
  2.  
  3. def divisorGenerator(n):
  4. large_divisors = []
  5. for i in range(1, int(math.sqrt(n) + 1)):
  6. if n % i == 0:
  7. yield i
  8. if i*i != n:
  9. large_divisors.append(n / i)
  10. for divisor in reversed(large_divisors):
  11. yield divisor
  12.  
  13. def divisorTest(ls):
  14. i = 0
  15. while i < len(ls):
  16. ls[i] %= 10
  17. i += 1
  18. result = True
  19. for val in range(10):
  20. if val not in ls:
  21. result = False
  22. return result
  23.  
  24. def test():
  25. n = 2
  26. result = False
  27. while not result:
  28. result = divisorTest(list(divisorGenerator(n)))
  29. n += 1
  30. return n-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement