Камардин Богдан Михайлович 307 NonPrime 8764 | doublem1nt84 NonPrime 9262 | ||||
---|---|---|---|---|---|
f | 1 | def nonprime(n=0): | f | 1 | def nonprime(n=0): |
n | 2 | k = n + 1 | n | 2 | now = n + 1 |
3 | while True: | 3 | while True: | ||
t | 4 | if k == 1: | t | 4 | if now == 1: |
5 | yield k | 5 | yield now | ||
6 | else: | ||||
7 | for i in range(2, int(k ** 0.5) + 1): | 6 | for i in range(2, int(now ** 0.5) + 1): | ||
8 | if k % i == 0: | 7 | if now % i == 0: | ||
9 | yield k | 8 | yield now | ||
10 | break | 9 | break | ||
11 | k += 1 | 10 | now += 1 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|