Primitive Recursive Arithmetic Function In Python