Permuted Multiples
Find the smallest positive integer x such that 2x, 3x, 4x, 5x, and 6x contain the same digits as x.
Problem Statement
This archive keeps the full statement, math, and original media on the page.
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.
Problem 52: Permuted Multiples
Mathematical Development
Formal Development
Definition 1 (Digit Multiset). For a positive integer with decimal representation , define as the sorted multiset of its decimal digits. Formally, .
Definition 2 (Permuted Multiple Property). An integer satisfies the permuted multiple property up to factor if for all .
Lemma 1 (Digit Count Preservation). If , then and have the same number of digits.
Proof. Two integers share the same digit multiset only if they have the same number of digits (the multiset determines the digit count).
Proposition 1 (Search Range Restriction). If has exactly digits and satisfies the permuted multiple property up to factor 6, then
Proof. Since has digits, . By Lemma 1, also has digits, so , giving .
Theorem 1 (Cyclic Numbers and Primitive Roots). Let be a prime such that (i.e., 10 is a primitive root modulo ). Define . Then is a cyclic number: for each , the product is a cyclic permutation of the digits of .
Proof. Since , the decimal expansion of has period exactly . Write
so and .
For , consider . Since 10 is a primitive root modulo , the fractional part of has the same repeating block as but cyclically shifted. Specifically, there exists an integer (depending on ) such that
Thus is the integer formed by this cyclic shift. Since cyclic permutations preserve digit multisets, .
Corollary 1. For , we have , so is a cyclic number. In particular:
Each product is a cyclic permutation of 142857, hence for .
Theorem 2 (Minimality of 142857). The value is the smallest positive integer satisfying for .
Proof. By Proposition 1, for each digit count , the search range is .
| Range | Size | |
|---|---|---|
| 1 | 1 | |
| 2 | 7 | |
| 3 | 67 | |
| 4 | 667 | |
| 5 | 6667 | |
| 6 | 66667 |
Exhaustive computation over yields no solution. For , the value satisfies the property by Corollary 1. No smaller 6-digit value in satisfies the condition (verified computationally).
Editorial
We search the positive integers in increasing order and compare each candidate with its first five nontrivial multiples. For a given value , we compute its canonical digit signature by sorting its decimal digits, then test whether the same signature appears for and . The first integer that passes all five comparisons is the smallest solution.
Pseudocode
Algorithm: Smallest Integer Whose First Six Multiples Are Digit Permutations
Require: The positive integers.
Ensure: The least x such that 2x, 3x, 4x, 5x, and 6x are permutations of the digits of x.
1: Initialize x ← 1.
2: Repeat:
3: Compute the canonical digit signature sigma(x).
4: If sigma(x) = sigma(2x) = sigma(3x) = sigma(4x) = sigma(5x) = sigma(6x), return x; otherwise update x ← x + 1.
Complexity Analysis
Proposition 2 (Time). The algorithm terminates after examining at most candidates. Each candidate requires 5 sorted-digit comparisons, each costing . With , each comparison is . Total: .
Proposition 3 (Space). for digit arrays.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
string sorted_digits(int n) {
string s = to_string(n);
sort(s.begin(), s.end());
return s;
}
int main() {
for (int x = 1; ; x++) {
string sd = sorted_digits(x);
bool ok = true;
for (int k = 2; k <= 6; k++) {
if (sorted_digits(k * x) != sd) {
ok = false;
break;
}
}
if (ok) {
cout << x << endl;
return 0;
}
}
return 0;
}
"""
Problem 52: Permuted Multiples
Find the smallest positive integer x such that 2x, 3x, 4x, 5x, and 6x
contain the same digits as x.
"""
def sorted_digits(n):
return sorted(str(n))
def solve():
x = 1
while True:
sd = sorted_digits(x)
if all(sorted_digits(k * x) == sd for k in range(2, 7)):
print(x)
return
x += 1
solve()