Smallest power of 6 whose decimal expansion contains n: Difference between revisions

(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 ← >1⧻◴⌕0⧻⊚⌕:∩°⋕
# Repeatedly multiple by 6 until the result contains n.
FindN ← ⊙◌⍢(×6|¬ Contains) 1
# Work out what the power was for each :-)
∵(⊟⁅÷∩(ₙ10)6 .FindN) ⇡22
</syntaxhighlight>
{{out}}
<pre>
╭─
[10077696 216 216 36 46656 46656 36 7776 2176782336 1296 10077696 2821109907456 1296 13060694016 131621703842267140 101559956668416 216 60466176 470184984576 21936950640377856 170581728179578200000 216]
╷ 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>
 
157

edits