Implemented foo(x)

Implemented the function foo(x). If x is a non-integer, foo(x) is nil.
If x <= 1, foo(x) is 1. Otherwise, foo(x) = foo(x - 1) * (x / 2).