Cubic special primes: Difference between revisions

→‎{{header|Wren}}: Now uses new core library method.
(Added solution for Action!)
(→‎{{header|Wren}}: Now uses new core library method.)
Line 630:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<lang ecmascript>import "/math" for Int, Math
import "/fmt" for Fmt
 
var isCube = Fn.new { |n|
var c = Mathn.cbrt(n).round
return c*c*c == n
}
Line 648:
gap = p - lastCubicSpecial
if (isCube.call(gap)) {
Fmt.print("$,7d $,7d $,6d $4d", lastCubicSpecial, p, gap, Mathgap.cbrt(gap).round)
lastCubicSpecial = p
count = count + 1
9,479

edits