Octave code for factorial function