implement elias omega algorithm