# Thread: Finding direct formula of recursive sequence

1. ## Finding direct formula of recursive sequence

I'm working on trying to find an explicit formula for the sum of a recursive sequence that is based on two parameters, $x$ and $y$. The parameters are fixed during the sequence, just the sequence and the sum of it are affected by an initial change in parameters.

$x,y \epsilon \mathbb{N}$.

$1\le y\le5$
$x>0$

$a_0 = \operatorname{floor}(\frac{x}{y})$
$a_1 = \operatorname{floor}(\frac{a_0+x\mod y}{y})$
$a_2 = \operatorname{floor}(\frac{a_1+a_0\mod y}{y})$
$\vdots$
$a_n = \operatorname{floor}(\frac{a_{n-1}+a_{n-2}\mod y}{y})$

The sequence eventually converges to 0 if $y>1$, so the sum is finite, but the sum is infinite if $y=1$.

To explain the sequence in a way that is less formulaic (my attempt at latex and putting the problem into a formula may have been incorrect), we find the quotient of $x$ and $y$, and then $x\mod y$ (the remainder). Add those two values together (call it $x_1$), then find the quotient of $x_1$ with $y$ and also $x_1\mod y$, and so on and so forth. Eventually the sequence will go to 0, if $y>1$, and we sum together the quotients from each step.

I'm inclined to believe that it isn't possible to find an explicit formula for the sum, but if it is, any help would be appreciated getting to it.

2. ## Re: Finding direct formula of recursive sequence

Admittedly, I have no idea how to mathematically arrive to it, but poking around with some code I managed to find this as the result for the finite sums (at least for all "relevant" numbers x, that is x<1000):

$\sum a_n = \operatorname{floor}(\frac{x-1}{y-1})$

3. ## Re: Finding direct formula of recursive sequence

Originally Posted by MasterNewbie
I'm working on trying to find an explicit formula for the sum of a recursive sequence that is based on two parameters, $x$ and $y$. The parameters are fixed during the sequence, just the sequence and the sum of it are affected by an initial change in parameters.
Why in the world did you not bother to state the actual (original wording) question?
You scribbling attempt at a solution tells us nothing about the actual question.

If you post the original question as well as what you have done, we may can help you.