newton sqrt and factorial