Никитин Михаил, 321 группа NonPrime 8664 | Кирилл Суглобов, 617 группа NonPrime 10209 | ||||
---|---|---|---|---|---|
n | 1 | from itertools import * | n | 1 | from itertools import count |
2 | 2 | ||||
3 | def nonprime(n=0): | 3 | def nonprime(n=0): | ||
t | 4 | for i in count(n + 1): | t | 4 | for num in count(n + 1): |
5 | if i == 1 or any((i % d == 0 for d in range(2, int(i ** 0.5) + 1 | 5 | if num == 1 or any((num % i == 0 for i in range(2, int(num ** 0. | ||
> | ))): | > | 5) + 1))): | ||
6 | yield i | 6 | yield num |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|