BCVIGM7NFXDF2O44TAH53F3LZUYBCWIUUEZHXJYH6B6VX3UE6B5QC
func ConcurrentSieve(limit int) []bool {
sieve := make([]bool, limit+1)
wg := new(sync.WaitGroup)
wg.Add(1)
go func() {
// handle even numbers
for i := 2 * 2; i <= limit; i += 2 {
sieve[i] = true
}
wg.Done()
}()
for p := 3; p*p <= limit; p += 2 {
wg.Add(1)
go func(p int) {
if !sieve[p] {
for i := p * p; i <= limit; i += p {
sieve[i] = true
}
}
wg.Done()
}(p)
}
wg.Wait()
return sieve
}