Jump to content

Permuted multiples: Difference between revisions

Add APL
(Add C)
(Add APL)
Line 7:
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.
<br><br>
 
=={{header|APL}}==
<lang apl>{(⍳6)×{⍵+1}⍣{1=≢∪{⍵[⍋⍵]}¨⍕¨⍺×⍳6}⊢⍵} 123</lang>
{{out}}
<pre>142857 285714 428571 571428 714285 857142</pre>
 
=={{header|AppleScript}}==
2,114

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.