Optimize extra strong Lucas test