func (s *NaiveSieve) NextPrime() (Number, error) {
	for true {
		candidate := s.generator.NextCandidate()
		if _, present := s.composites[candidate]; !present {
			s.composites[candidate*candidate] = []Number{candidate}
			return candidate, nil
		}
		for _, c := range s.composites[candidate] {
			if _, present := s.composites[candidate+c]; !present {
				s.composites[candidate+c] = []Number{}
			}
			s.composites[candidate+c] = append(s.composites[candidate+c], c)
		}
		delete(s.composites, candidate)
	}
	return 0, errors.New("Unreachable! Should not execute this instruction!")
}
// NextPrime returns the next prime in sequence
NextPrime returns the next prime in sequence
// NextPrime returns the next prime in sequence
func (s *NaiveSieve) NextPrime() (Number, error) {
	for true {
		candidate := s.generator.NextCandidate()
		if _, present := s.composites[candidate]; !present {
			s.composites[candidate*candidate] = []Number{candidate}
			return candidate, nil
		}
		for _, c := range s.composites[candidate] {
			if _, present := s.composites[candidate+c]; !present {
				s.composites[candidate+c] = []Number{}
			}
			s.composites[candidate+c] = append(s.composites[candidate+c], c)
		}
		delete(s.composites, candidate)
	}
	return 0, errors.New("Unreachable! Should not execute this instruction!")
}
func ( s * NaiveSieve ) NextPrime ( ) ( Number , error ) { for true { candidate := s . generator . NextCandidate ( ) if _ , present := s . composites [ candidate ] ; ! present { s . composites [ candidate * candidate ] = [ ] Number { candidate } return candidate , nil } for _ , c := range s . composites [ candidate ] { if _ , present := s . composites [ candidate + c ] ; ! present { s . composites [ candidate + c ] = [ ] Number { } } s . composites [ candidate + c ] = append ( s . composites [ candidate + c ] , c ) } delete ( s . composites , candidate ) } return 0 , errors . New ( " " ) }
NextPrime returns the next prime in sequence
NextPrime returns the next prime in sequence