optimize Euler product