I want to factor a large range of numbers (for example, say all numbers from 1 to 1 billion). I know I should be able to use some sort of sieve to do this. For example, I know every second numbers is divisible by 2, every third number is divisible by 3 etc etc. But I am struggling to implement this (using python).
Does anyone have any suggestions on a good way to implement this?