Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #It can be seen that the number, 125874, and its double, 251748, contain
- #exactly the same digits, but in a different order.
- #Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x,
- #contain the same digits.
- def isMultsPerms(n):
- nStr = str(n)
- if len(nStr) == len(str(n*2)) == len(str(n*3)) ==\
- len(str(n*4)) == len(str(n*5)) == len(str(n*6)):
- count = 0
- for i in nStr:
- if i in str(n*2) and i in str(n*3) and i in str(n*4)\
- and i in str(n*5) and i in str(n*6):
- count += 1
- if count == len(nStr):
- return True
- else:
- return False
- i = 1
- while True:
- if isMultsPerms(i):
- print i
- break
- i += 1
Advertisement
Add Comment
Please, Sign In to add comment