Own digits power sum: Difference between revisions

m
(Reformatting code.)
 
(One intermediate revision by one other user not shown)
Line 48:
:NUMBERS.append(Int(result))
 
F next_digit(=dgt, depth) -> NVoid
‘ 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="ecmascriptwren">import "./math" for Int
 
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="ecmascriptwren">import "./seq" for Lst
 
var maxBase = 10
1,481

edits