Brilliant numbers: Difference between revisions

Content added Content deleted
Line 1,004: Line 1,004:
=={{header|Swift}}==
=={{header|Swift}}==
Magnitudes of 1 to 3 is decent, 4 and beyond becomes slow.
Magnitudes of 1 to 3 is decent, 4 and beyond becomes slow.
<lang rebol>func primeArray(n: Int) -> [Bool] {
<lang rebol>
//Using Sieve of Eratosthenes
func primeArray(n: Int) -> [Bool] {
var primeArr = [Bool](repeating: true, count: n + 1)
var primeArr = [Bool](repeating: true, count: n + 1)