Example of a sequence that converges numerically to a limit other than its true (algebraic) limit We can use increasing n-values to numerically approach the limit of a sequence. In all the examples I have seen so far I can reliably determine the limit by just plugging in 10,100,1000 as n and see what the limit is. However I'm told that we have to determine the limit algebraically. Can somebody show me a sequence where the sequence converges to a false limit when approaching it numerically. $(n=10,100,1000)$. I'm only familiar with sequences in $\Bbb R$. Bonus points if $n > 10^{98} $ which would be a number I cannot enter in my calculator.
Edit: I'm not looking for "piecewise" sequence definitions where this property would be obvious
Edit2: A made-up example of what I'm looking for
$a_1 = 1.5,a_{10} = 1.8, a_{100} = 1.9, a_{1000} = 1.99, a_{10000} = 1.999, a_{100000} = 1.9999, a_{1000000} = 2.9999$
 A: The problem with numerical calculation is that it has an error because of the precision of number representation of floating  point numbers. There is a term that can be helpful for this, called machine epsilon, which essentially tells you, what relative error you can expect, when you calculate with a computer.
$$\varepsilon_{single} \approx 1.2  \cdot 10^{-7} \text{ for single precision floating point numbers}$$
$$\varepsilon_{double} \approx 2.2  \cdot 10^{-16} \text{ for doubleprecision floating point numbers}$$
This error occurs at every step of a computations, but usually negligible. A simple example when this error becomes large, is when you add numbers on different scales.
$$\text{For example: } float(10^{20} + 1) = float(10^{20})$$
A good example to show when this becomes problematic, is Martin R said in his comment.
$$a_n = \bigg(1 + \frac{1}{10^n}\bigg)^{10^n}$$
When you evaluate this with a computer then the inner part will be evaluated first. For a larger $n$ ($\frac{1}{10^n} < \varepsilon$), this would mean that
$$float\bigg(1 + \frac{1}{10^n}\bigg) = float(1)$$
So the result of the computation will be $1$.
While correct  answer for large $n$ would be:
$$a_n \approx e = 2.71828...$$
Bonus: $n>10^{98}$ doesn't really maes things harder. After minor modifications in the following example, you have the same result.
$$b_n := \bigg(1 + \frac{\varepsilon \cdot 10^{98}}{n}\bigg)^{\frac{n}{\varepsilon \cdot  10^{98}}}$$
A: Compilation of examples where your procedure doesn't work:

*

*Piecewise defined sequence like $x_n = 0$ if $n < 10^{98}$, $x_n = 1$ elsewhere. Even if this is not what you're looking for, it proved your procedure doesn't work in general.


*Sequences hard to calculate. How are you going to apply this if you can't even calculate it for $n>10$? Like:
$$x_n = \frac{n!}{10^{10^{n}}},$$
or:
$$ x_n = \int_0^{1/n} (\sin(\frac{1}{x}))^{n!^2} dx. $$
In both cases the limit is easy to obtain algebraically though.


*Open problems in math are about sequences of which we know the first millions of terms. Take the Collatz conjecture, for example, and define $x_n$ as the maximum limit obtained when we apply over and over the $f$ of Collatz to a number lower or equal than $n$. We know the value is $1$ for the first millions of terms. It's still unknown if there is any number greater than that in the sequence. Your procedure fails here because it claims more than it should, the fact that we know the first terms doesn't mean much for the limit.


*Continuous functions where your procedure thinks there is a limit, but there is not:
$$x_n = \sin(\log(\log(n))),$$
for $n=100, 1000, ...$ this gives (rounded to two decimals):
$$ \{0.99, 0.93, 0.79, 0.64, 0.49, 0.35, 0.22, 0.11, 0.004\}$$
If you stop there it would seem the function converges to $0$, but the limit is indeterminate.
A: Consider the function $$2+\tanh(x-10^{99})$$
import math

for x in range(95, 101):
    print(2+math.tanh(10**x - 10**99))

shows that for values less than $10^{98}$, it is close to $1$, it then grows to $2$ at $x=10^{99}$ and then grows to $3$ at $x=10^{100}$.
This is a graph of $2+\tanh(100(x-100))$ as a reference:

Note that I can shift the "jumping point" to arbitrary location.
