My math textbook defines a linear recurrence relation $a_n = f(a_{n-1}, a_{n-2}, ... a_{n-r}) + g(n)$ with initial values $a_0, a_1, ... a_r$ as follows:
If $f(a_{n-1}, a_{n-2}, ... a_{n-}r) = h_1(n)a_{n-1} + h_2(n)a_{n-2} + ... + h_r(n)a_{n-r}$ for some functions $h_1, h_2, ... , h_r$ of $n$, then the recurrence relation is linear, otherwise it is nonlinear.
The textbook goes on to provide $a_0 = 1, a_1 = 5, a_2 = -2, a_n = a_{n-1}^2 + a_{n-2}a_{n-3}, n \ge 3$ as an example of a nonlinear recurrence relation. The problem is, under the given definition of a linear recurrence relation, this can be written as a linear recurrence relation!
Define $h_1(n) = a_{n-1}$ and $h_2(n) = a_{n-3}$. Then, $a_n = h_1(n)a_{n-1} + h_2(n)a_{n-2}$. By the given definition, this is a linear function.
You can trivially resolve this by saying that $h_i(n)$ cannot contain any references to $a$. However, this runs into another problem. Define a recurrence relation $b_0 = 1, b_1 = 5, b_2 = -2, b_n = b_{n-1}^2 + b_{n-2}b_{n-3}, n \ge 3$. Obviously, $b_n = a_n$. Therefore, we can write $h_1(n) = b_{n-1}$ and $h_2(n) = b_{n-3}$. Now, we've defined $a_n$ in terms of a linear combination of previous values of $a$!
I don't pretend to believe that I've come up with a fundamental problem in mathematics. However, the sloppy definition in my textbook does bother me. I was wondering if there was a more rigorous definition of a linear recurrence that was not in my textbook.