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

m (→‎{{header|Raku}}: remove redundant routine)
Line 1,479:
21 6^3 = 216
</pre>
 
=={{header|Yabasic}}==
{{trans|Python}}
<lang Yabasic>// Rosetta Code problem: http://rosettacode.org/wiki/Smallest_power_of_6_whose_decimal_expansion_contains_n
// by Galileo, 05/2022
 
sub smallest_six(n)
local p, n$
n$ = str$(n)
p = 1
while not instr(str$(p, "%1.f"), n$) p = p * 6 : wend
return p
end sub
for n = 0 to 21 : print n, ": ", str$(smallest_six(n), "%1.f") : next</lang>
{{out}}
<pre>0: 10077696
1: 1
2: 216
3: 36
4: 46656
5: 46656
6: 6
7: 7776
8: 2176782336
9: 1296
10: 10077696
11: 2821109907456
12: 1296
13: 13060694016
14: 6140942214464815497216
15: 101559956668416
16: 216
17: 60466176
18: 470184984576
19: 21936950640377856
20: 170581728179578208256
21: 216
---Program done, press RETURN---</pre>
672

edits