Smallest power of 6 whose decimal expansion contains n: Difference between revisions
Smallest power of 6 whose decimal expansion contains n (view source)
Revision as of 21:04, 19 May 2024
, 1 month ago→{{header|Uiua}}
(Added Uiua solution) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1,696:
<syntaxhighlight lang="uiua">
# Does number a contain subseq b? (a b) -> bool
Contains ← >
# Repeatedly multiple by 6 until the result contains n.
FindN ← ⊙◌⍢(×6|¬ Contains) 1
# Work out what the power was
∵(⊟⁅÷∩(ₙ10)6 .FindN) ⇡22
</syntaxhighlight>
{{out}}
<pre>
╭─
╷ 9 10077696
0 1
3 216
2 36
6 46656
6 46656
1 6
5 7776
12 2176782336
4 1296
9 10077696
16 2821109907456
4 1296
13 13060694016
22 131621703842267140
18 101559956668416
3 216
10 60466176
15 470184984576
21 21936950640377856
26 170581728179578200000
3 216
╯
</pre>
|