Smarandache prime-digital sequence: Difference between revisions

Content added Content deleted
(Added C solution)
m (Typo fix)
Line 234: Line 234:
for (uint32_t p = 2; p * p <= limit; ++p) {
for (uint32_t p = 2; p * p <= limit; ++p) {
if (bit_array_get(&s->not_prime, p) == false) {
if (bit_array_get(&s->not_prime, p) == false) {
for (size_t q = p * p; q <= limit; q += p)
for (uint32_t q = p * p; q <= limit; q += p)
bit_array_set(&s->not_prime, q, true);
bit_array_set(&s->not_prime, q, true);
}
}