Program optimize: calculate sqrt(n) only once