I ran into examples that I not trivially understand on course-of-values recursion,
In defining a function by primitive recursion, the value of the next argument $f(n+1)$ depends only on the value of the current argument $f(n)$. Definition of functions by course-of-values recursion, $f(n+1)$ depends on value(s) of some or all of the preceding arguments $f(n),…,f(0)$. very basic examples of definition by course-of-values recursion are Fibonacci numbers...
My examples, from the computation course, wrote following $f_1$ and $f_2$ is Primitive recursive. I reproduce them here:
Let $g$ be a
primitive recursive function,
$f_1(0)=c_1, f_1(1)=c_2, f_1(x+2)=g(x,f_1(x),f_1(x+1))$, and
$f_2(x)=c, f_2(x+1)=g(x,[f_2(0),...,f_2(x)])$ are
I couldn't say how $f_1$ and $f_2$ are Primitive Recursive? any idea to finding these are P.R.?
Edit 1: after the Yuval Hint the $f_1$ is easy, but for $f_2$ there is a problem, I try more than three days, but not capable to create an easy encode for $f_2$. any hint or idea?