How many ways to reach $1$ from $n$ by doing $/13$ or $-7$ ?
(i.e., where $n$ is the starting value (positive integer) and $/13$ means division by $13$ and $-7$ means subtracting 7)?
Let the number of ways be $f(n)$.
Example $n = 20$ , then $f(n) = 1$ since $13$ is not a divisor of $20$ , we start $20-7=13$ , then $13/13 = 1$.
(edit) : Let $g(n)$ be the number of steps needed.(edit)
We can show easily that $f(13n) = f(n) + f(13n-7).$ Or if $n$ is not a multiple of $13$ then $f(n) = f(n-7).$
(edit): I believe that $g(13n) = g(n) + g(13n-7) + 2.$ Or if $n$ is not a multiple of $13$ then $g(n) = g(n-7) + 1.$ Although this might require negative values.
( with thanks to Ross for pointing out the error )(edit)
Those equations look simple and familiar , somewhat like functional equations for logaritms , partition functions , fibonacci sequence and even collatz like or a functional equation I posted here before. I consider modular aritmetic such as mod $13^2$ and such but with no succes sofar.
How to solve this ? Does it have a nice generating function ? Is there a name for the generalization of this problem ? Because it seems very typical number theory. Is this related to q-analogs ?
Some suggestions to help you on your way:
You should have $$f(13n) = f(n) + f(13n-7) $$ and when $n$ is not a multiple of $13$ then $$f(n) = f(n-7)$$ starting at $f(1)=1$ and $f(n)=0$ for $n \lt 1$.
Since $13 \equiv -1 \pmod 7$ and $13^2\equiv 1 \pmod 7$, you have the result that $f(n)=0$ unless $n \equiv \pm 1 \pmod 7$.
The first time you have $f(n)=2$ is when $n=104 = 13\times(7+1)$.
If there is a particular value for $f(7n+1) \gt 1$ for some $n$, then there are $13$ such $n$ giving that value. Similarly if there is a value for $f(7n-1) \gt 1$ for some $n$, then there are $13$ such $n$ giving that value.
There is no $n$ for which $f(n)=25$.