Permuted Multiples

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.


The answer is 142857.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Harrison Wang
Mar 29, 2014

The solution is well-known; it is the repeating sequence in the decimal expansions of the multiples of one-seventh between 0 and 1.

Damiann Mangan
Mar 11, 2014

Here's my source code in python,

foo = []
for i in xrange(1,1000000):
    if len(str(i*2)) == len(str(i*7)):
        pass
    else:
        continue

    foo = [str(j * i) for j in xrange(2,7)]

    set0 = list(set(foo[0]))
    sets = True
    for j in xrange(1, len(foo)):
        sets = set0 == list(set(foo[j]))
        if sets == False:
            break
    if sets == False:
        continue

    print i
    break
Bill Bell
Jan 28, 2015

Have seen this problem somewhere else, can't remember where. This code displays an easy way of comparing sets of digits.

Gaurav Dhingra
Oct 5, 2014

def isPermutedString(a, b): if len(a) != len(b): return False for i in a: if i not in b: return False return True

def isTrue(n): array = [n 2, n 3, n 4, n 5, n*6] for i in array: if isPermutedString(str(n), str(i))!=True: return return n

for i in range(1,10000000): isTrue(i):

Connor Kenway
Apr 22, 2014

http://ideone.com/Ymn0kU the program gives output 142857

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...