user
Attribution

The following task is taken from Project Euler.

Task

Find the smallest positive integer **n** such that, when expressed in decimal, 2\*n, 3\*n, 4\*n, 5\*n, and 6\*n contain *exactly* the same digits but in a different order.
assistant
```
put display (^∞).map(1 ~ *).race.map( -> \n { next unless [eq] (2,3,4,5,6).map: { (n × $_).comb.sort.join }; n } ).first;

sub display ($n) { join "\n", " n: $n", (2..6).map: { "×$_: {$n×$_}" } }

```

Output:

```
 n: 142857
×2: 285714
×3: 428571
×4: 571428
×5: 714285
×6: 857142

```