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

Content added Content deleted
Line 405: Line 405:
ind = substr(strpow,strn)
ind = substr(strpow,strn)
if ind > 0
if ind > 0
see "" + n + ". " + strpow + " - " + m + nl
see "" + n + ". " + "6^" + m + " = " + strpow + nl
exit
exit
ok
ok
Line 417: Line 417:
working...
working...
Smallest power of 6 whose decimal expansion contains n:
Smallest power of 6 whose decimal expansion contains n:
1. 1 - 0
1. 6^0 = 1
2. 216 - 3
2. 6^3 = 216
3. 36 - 2
3. 6^2 = 36
4. 46656 - 6
4. 6^6 = 46656
5. 46656 - 6
5. 6^6 = 46656
6. 6 - 1
6. 6^1 = 6
7. 7776 - 5
7. 6^5 = 7776
8. 6^12 = 2176782336
8. 2176782336 - 12
9. 1296 - 4
9. 6^4 = 1296
10. 10077696 - 9
10. 6^9 = 10077696
11. 6^16 = 2821109907456
11. 2821109907456 - 16
12. 1296 - 4
12. 6^4 = 1296
13. 13060694016 - 13
13. 6^13 = 13060694016
14. 6^28 = 6140942214464815497216
14. 6140942214464815497216 - 28
15. 6^18 = 101559956668416
15. 101559956668416 - 18
16. 216 - 3
16. 6^3 = 216
17. 60466176 - 10
17. 6^10 = 60466176
18. 6^15 = 470184984576
18. 470184984576 - 15
19. 6^21 = 21936950640377856
19. 21936950640377856 - 21
20. 6^26 = 170581728179578208256
20. 170581728179578208256 - 26
21. 216 - 3
21. 6^3 = 216
done...
done...

</pre>
</pre>