Jump to content

Pierpont primes: Difference between revisions

→‎{{header|Wren}}: Now uses new core library method.
(→‎{{header|Wren}}: Now uses new core library method.)
Line 2,842:
{{trans|Go}}
{{libheader|Wren-big}}
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
The 3-smooth version. Just the first 250 - a tolerable 14 seconds or so on my machine.
<lang ecmascript>import "/big" for BigInt
import "/math" for Math
import "/fmt" for Fmt
 
Line 2,887 ⟶ 2,885:
count2 = count2 + 1
}
count = Mathcount1.min(count1, count2)
}
}
Line 2,893 ⟶ 2,891:
}
 
var start = System.clock
var p = pierpont.call(250, true)
System.print("First 50 Pierpont primes of the first kind:")
Line 2,907 ⟶ 2,904:
 
System.print("\n250th Pierpont prime of the first kind: %(p[0][249])")
System.print("\n250th Pierpont prime of the second kind: %(p[1][249])")</lang>
System.print("Took %(System.clock - start)")</lang>
 
{{out}}
9,482

edits

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