0

This I did also after 'spying' discussions in other forum. Of course you would use sieve prime generation for bigger numbers, but I proved other simple way for a change.

Slightly more advanced primes list generator would use primes % 6 in (1,5) property:

```
def primes(n):
""" primitive non-sieve prime finder """
p = [2, 3]
candidate, step = 5, 2
while candidate <= n:
if all(candidate % pr for pr in p):
p.append(candidate)
candidate += step
# consider only number % 6 in (1,5) ie 6*n +- 1
step = 2 if step == 4 else 4
return p
```

*Edited 5 Years Ago by pyTony*: n/a