0

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}$$

sten
  • 149
  • 1
    $$y_{i+1}=\frac{1}{1+1/y_i}$$ You compute the index by computing its reciprocal. – Mason Sep 15 '21 at 03:52
  • @Mason: Could you please write this as an answer? – Taladris Sep 15 '21 at 03:57
  • If $y_{?????} = K$ then $y_{??????} = \frac 1{???????} = K$. SO $??????? = \frac 1K$ which is an integer. And $y_{????????+1} = \frac 1{???????? + 1} = \frac 1{\frac 1K + 1}$. – fleablood Sep 15 '21 at 04:29
  • @Mason thanks, can you write how did you came up with the solution, so i can apply it for other formulas – sten Sep 15 '21 at 15:10

3 Answers3

1

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

Mason
  • 3,792
1

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.

fleablood
  • 124,253
1

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}$.

user247327
  • 18,710