Calculate the next value?

231 Views Asked by At

I'm generating the following sequence , $i = 1 \dots \infty$: $$ y_i = 1/i $$ Given that I have the calculated-value of :

$$ y_x $$

how do I calculate the next value $y_{x+1}$ ? I don't know the index '$x$', I know only the value $y_x$

For example,

if $y_x$ = 0.167 then $y_{x+1}$ = 0.143 i.e. $1/6 \implies 1/7$

I keep only the calculated value, not the current index.


Detailed :

$$y_x = k; k= {\frac 1x}; x = {\frac 1k}$$

$$ y_{x+n} = \frac {1} {x+n} = \frac {1} {{\frac 1k}+n} = \frac {1} {{\frac 1 {y_{x}}}+n}$$

3

There are 3 best solutions below

0
On BEST ANSWER

Just do it.

If you have a term $y_{unknown\ index} = K$. then $K = \frac 1{unknown\ index}$ and $unknown\ index = \frac 1K$ (which will be an integer).

So the next terms is $y_{unknown\ index+ 1} = y_{\frac 1K + 1}=\frac 1{\frac 1K + 1}$.

That's all there is to it.

0
On

$$y_{i+1}=\frac{1}{1+1/y_i}$$ You compute the index by computing its reciprocal.

0
On

If $y_i= \frac{1}{i}$ then, multiplying both sides by i, $iy_i= 1$ so $i= \frac{1}{y_i}$. If $y_i= K$ then $i= \frac{1}{K}$. $i+1= \frac{1}{K}+ 1= \frac{1}{K}+ \frac{K}{K}= \frac{K+ 1}{K}$.

So $y_{i+1}= \frac{1}{\frac{K+ 1}{K}}= \frac{K}{K+ 1}$.