17 lines
339 B
Go
17 lines
339 B
Go
|
package primes
|
||
|
|
||
|
var seed = []int64{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71}
|
||
|
|
||
|
// FirstN returns the first n-amount of prime numbers.
|
||
|
func FirstN(n int) []int64 {
|
||
|
if n <= 20 {
|
||
|
return seed
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// IsPrime checks if n is prime number.
|
||
|
func IsPrime(n int64) bool {
|
||
|
return primes.IsPrime(n)
|
||
|
}
|