Primes whose sum of digits is 25: Difference between revisions

m
m (→‎J: simplify)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 2,217:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="wren">import "./math" for Int
{{libheader|Wren-seq}}
<syntaxhighlight lang="ecmascript">import "./mathfmt" for IntFmt
import "/fmt" for Fmt
import "/seq" for Lst
 
var sumDigits = Fn.new { |n|
Line 2,237 ⟶ 2,235:
}
System.print("The %(primes25.count) primes under 5,000 whose digits sum to 25 are:")
for (chunk in Lst.chunks(primes25, 6)) Fmt.printtprint("$,6d", chunkprimes25, 6)</syntaxhighlight>
 
{{out}}
Line 2,250 ⟶ 2,248:
{{libheader|Wren-gmp}}
Run time is about 25.5 seconds.
<syntaxhighlight lang="ecmascriptwren">import "./gmp" for Mpz
import "./fmt" for Fmt
 
9,476

edits