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

Content added Content deleted
m (→‎{{header|Free Pascal}}: using a seperate array for used numbers increases speed. 14 -> 9.1 secs)
m (→‎{{header|Free Pascal}}: Commatize was a huge time factor)
Line 912:
=={{header|Pascal}}==
==={{header|Free Pascal}}===
Doing long multiplikation like in primorial task.<BR>I used to check every numberstring one after the other on one 6^ n string.Gets really slow on high n<BR>After a closer look into [[Phix|Smallest_power_of_6_whose_decimal_expansion_contains_n#Phix]] I applied a slghtly modified version of Pete, to get down < 10 secs on my 2200G for DIGITS = 7.TIO.RUN is slower.
Removed Commatize in string assignment.Saves much time.But converting all afterwards consumes even more.
<syntaxhighlight lang="pascal">program PotOf6;
//First occurence of a numberstring with max decimal DIGTIS digits in 6^n