Own digits power sum: Difference between revisions
m
→{{header|11l}}: Void
(Reformatting code.) |
Alextretyak (talk | contribs) m (→{{header|11l}}: Void) |
||
(One intermediate revision by one other user not shown) | |||
Line 48:
:NUMBERS.append(Int(result))
F next_digit(=dgt, depth) ->
‘ get next digit at the given depth ’
I depth < :MAX_BASE - 1
Line 2,335:
{{libheader|Wren-math}}
Includes some simple optimizations to try and quicken up the search. However, getting up to N = 9 still took a little over 4 minutes on my machine.
<syntaxhighlight lang="
var powers = [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Line 2,404:
{{libheader|Wren-seq}}
Astonishing speed-up. Runtime now only 0.5 seconds!
<syntaxhighlight lang="
var maxBase = 10
|