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