MathDemos:Odd Primes Mask

Odd Primes Mask: `if is_prime(2*k+1) 1 else 0`; 0111011011010011...
It can be implemented by Bitset in sagemath or bitarray in Python.

Sieve of Eratosthenes by OddPrimesMask


opm=Bitset('01'+'110' * (5*bits//3-1))
# 2*2*top+2+top=bits
for b in (
    for a in (2..b):
        #if 2*a*b+a+b <= bits:

Sieve of Sundaram

**Prime-Gap-Subsegments-Theorem**: In prime gap sequence, if any subsegment occurs twice, then it will continue to occur infinitely times. such as `{2}, {4},{2*k},{2,4,2},{6,6},{2,6,4,2}...`. In other words, any repeated substring of OddPrimesMask occures infinitely times. Such as `0`*k, `101101101`, `1001001`,...