Brilliant numbers: Difference between revisions

Content added Content deleted
(Added Java solution)
Line 1,114: Line 1,114:
=={{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>//Using Sieve of Eratosthenes
<lang rebol>// Refs:
// https://www.geeksforgeeks.org/sieve-of-eratosthenes/?ref=leftbar-rightbar
// https://developer.apple.com/documentation/swift/array/init(repeating:count:)-5zvh4
// https://www.geeksforgeeks.org/brilliant-numbers/#:~:text=Brilliant%20Number%20is%20a%20number,25%2C%2035%2C%2049%E2%80%A6.
//Using Sieve of Eratosthenes
func primeArray(n: Int) -> [Bool] {
func primeArray(n: Int) -> [Bool] {