optimized euler49