Jump to content

Increasing gaps between consecutive Niven numbers: Difference between revisions

m
No edit summary
m (→‎{{header|Wren}}: Minor tidy)
Line 2,225:
{{libheader|Wren-fmt}}
Limited to Niven numbers up to 1 billion in order to finish in a reasonable time (a little under 2 minutes on my machine).
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
 
var newSum // recursive
Line 2,267:
var g = n - pn
if (g > pg) {
SystemFmt.print("%(Fmt.d(3,$3d g)) %(Fmt.dc(13$,13d i)) $,14d", %(Fmt.dc(14g, i, pn))")
pg = g
}
9,490

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.