Yellowstone sequence: Difference between revisions

→‎{{header|Wren}}: Now uses Wren-math module.
(Added Wren)
(→‎{{header|Wren}}: Now uses Wren-math module.)
Line 1,133:
=={{header|Wren}}==
{{trans|Go}}
{{libheader|Wren-math}}
Without the extra credit part.
<lang ecmascript>varimport gcd"/math" =for Fn.new { |x, y|Int
while (y != 0) {
var t = y
y = x % y
x = t
}
return x
}
 
var yellowstone = Fn.new { |n|
Line 1,154 ⟶ 1,148:
var i = min
while (true) {
if (!m[i] && gcdInt.callgcd(a[c-1], i) == 1 && gcdInt.callgcd(a[c-2], i) > 1) {
a[c] = i
m[i] = true
9,490

edits