Show that function is primitive recursive.

337 Views Asked by At

Having trouble with showing that function is primitive recursive. Have the following problem.

Let $ f: \mathbb{N} \rightarrow \mathbb{N}$ be decreasing function. Show that $f$ is primitive recursive.

I see that $f$ will eventually decrease to a certain constant and that I could say that it is a constant function with over certain numbers which would make it primitive recursive. I don't think this is enough, however, and that I need something more.

1

There are 1 best solutions below

3
On BEST ANSWER

Why isn't that enough? An algorithm to calculate it could be of the form

if n = 1 then return ...
else if n = 2 then return ...
else ...
else return ...