I'm trying to get a list with all numbers that are in the form 6n+1 or 6n-1. Currently I have this:
n = 100000000
l = int(n/6)
f1 = lambda x: (6*x)-1
f3 = lambda x: (6*x)+1
primeCandidate = [f(i) for i in range(1,l+1) for f in (f1,f3)]
This works nicely, and it gets me 2 values on the list per i, but I was wondering if I could do something similar with NumPy arrays
rangewith defining the step?range(1,l+1)torange(1,n,6)?