Home primes: Difference between revisions
m
→{{header|Raku}}: oops, fencepost error
Thundergnat (talk | contribs) (→{{header|Raku}}: Plagiarize underscore separator idea from Phix, add some basic timing info., do partial HP49) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: oops, fencepost error) |
||
Line 296:
Not the fastest, but not too bad either. Make an abortive attempt at HP49.
Assuming there are n steps; HP49(n -
Using [https://modules.raku.org/search/?q=Prime+Factor Prime::Factor] from the [https://modules.raku.org/ Raku ecosystem].
Line 320:
while (@factors = prime-factors @steps[*-1].Int) > 1 {
@steps.push: @factors.join('_');
say "HP{@steps[$step].Int}\(n - {
$now = now;
last if $step
}</lang>
{{out}}
Line 343:
HP18(1) = 2_3_3 (0.000 seconds)
HP19 = 19 (0.000 seconds)
HP20(15) = HP2_2_5(14) = HP3_3_5_5(13) = HP5_11_61(12) = HP11_4651(11) = HP3_3_12739(10) = HP17_194867(9) = HP19_41_22073(8) = HP709_273797(7) = HP3_97_137_17791(6) = HP11_3610337981(5) = HP7_3391_4786213(4) = HP3_3_3_3_7_23_31_1815403(3) = HP13_17_23_655857429041(2) = HP7_7_2688237874641409(1) = 3_31_8308475676071413 (0.
HP65(19) = HP5_13(18) = HP3_3_3_19(17) = HP11_13_233(16) = HP11_101203(15) = HP3_3_23_53629(14) = HP3_3_1523_24247(13) = HP3_3_3_7_47_3732109(12) = HP11_18013_16843763(11) = HP151_740406071813(10) = HP3_13_13_54833_5458223(9) = HP3_3_97_179_373_7523_71411(8) = HP1571_1601_1350675311441(7) = HP3_3_13_33391_143947_279384649(6) = HP11_23_204069263_6417517893491(5) = HP7_11_1756639_83039633268945697(4) = HP29_29_5165653_13503983_12122544283(3) = HP228345060379_1282934064985326977(2) = HP3_3_3_2979253_3030445387_9367290955541(1) = 1381_3211183211_75157763339900357651 (6.
Total elapsed time: 6.
HP49:
HP49(n -
HP77(n -
HP711(n -
HP3379(n -
HP31109(n -
HP132393(n -
HP344131(n -
HP1731653(n -
HP71143523(n -
HP11115771019(n -
HP31135742029(n -
HP717261644891(n -
HP11193431873899(n -
HP116134799345907(n -
HP3204751189066719(n -
HP31068250396355573(n -
HP62161149980213343(n -
HP336906794442245927(n -
HP734615161567701999(n -
HP31318836286194043641(n -
HP333431436916146111627309(n -
HP33205716184556772142207827(n -
HP31367222155734752971376323127(n -
HP733915126325777821480557336017(n -
HP476734743112036198712947236602187(n -
HP377171280957470909577133234490256751(n -
HP3096049809383121823389214993262890297(n -
HP73796236325118712936424989555929478399(n -
HP13118114526141133089538087518197265265053(n -
HP319521441731977174163487542111577539726749(n -
HP595415617656474189392601483764603009147911(n - 30) = 13_8423_1466957_3706744784027901056001426046777 (0.015 seconds)</pre>
=={{header|Wren}}==
|