**Problem 52:**

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 2*x*, 3*x*, 4*x*, 5*x*, and 6*x*, contain the same digits.

**Idea:**

I felt like being lazy for this one, partly because the method I had in mind would fail quickly for each incorrect answer, and partly because I already have a method to see if a number is a permutation thanks in part to Problem 24. I just did what the problem said:

Pick a number, multiply it by 2, see if it’s a permutation. If not, continue to the next number, otherwise, repeat with 3x, 4x, 5x, and 6x.

int answer = -1; boolean found = false; int number = 1; while(!found) { if(EulerUtils.Permutation.isPermutation(number, number*2)) { if(EulerUtils.Permutation.isPermutation(number, number*3)) { if(EulerUtils.Permutation.isPermutation(number, number*4)) { if(EulerUtils.Permutation.isPermutation(number, number*5)) { if(EulerUtils.Permutation.isPermutation(number, number*6)) { found = true; answer = number; } } } } } number++; }