func generate_prime(start int64, end int64, c chan int64) { for i := start; i < end; i += 2 { if helpers.IsPrime(i) { c <- i } } close(c) }
func main() { const num int64 = 600851475143 var i int64 = helpers.Sqrt(num) for ; i > 1; i-- { if num%i == 0 && helpers.IsPrime(i) { fmt.Println(i) break } } }
func main() { count := 0 var i int64 = 3 for ; ; i += 2 { if helpers.IsPrime(i) { count += 1 } if count == 10000 { fmt.Println(i) break } } }