# 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, $\displaystyle x$ and $\displaystyle y$. The parameters are fixed during the sequence, just the sequence and the sum of it are affected by an initial change in parameters.

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

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

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

The sequence eventually converges to 0 if $\displaystyle y>1$, so the sum is finite, but the sum is infinite if $\displaystyle 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 $\displaystyle x$ and $\displaystyle y$, and then $\displaystyle x\mod y$ (the remainder). Add those two values together (call it $\displaystyle x_1$), then find the quotient of $\displaystyle x_1$ with $\displaystyle y$ and also $\displaystyle x_1\mod y$, and so on and so forth. Eventually the sequence will go to 0, if $\displaystyle 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):

$\displaystyle \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, $\displaystyle x$ and $\displaystyle 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.