An Arithmetic Geometric Sequence
Given u(k) = (900 - 3k) r^(k-1), let s(r) = sum_(k=1)^5000 u(k). Find the value of r for which s(r) = -600,000,000,000, correct to 12 decimal places.
Problem Statement
This archive keeps the full statement, math, and original media on the page.
Given is the arithmetic-geometric sequence \(u(k) = (900-3k)r^{k - 1}\).
Let \(s(n) = \sum _{k = 1}^n u(k)\).
Find the value of \(r\) for which \(s(5000) = -600\,000\,000\,000\).
Give your answer rounded to \(12\) places behind the decimal point.
Problem 235: An Arithmetic Geometric Sequence
Mathematical Foundation
Theorem (Closed-Form Summation). For , define . Then
Proof. We split the sum:
The first sum is a geometric series: .
For the second sum, differentiate the geometric series identity with respect to :
This is verified by the quotient rule: the numerator of the derivative of is . Substituting completes the proof.
Lemma (Existence and Uniqueness of Root). The equation has a unique solution in .
Proof. At : .
For slightly above 1, the terms with (where ) are amplified by , causing to decrease monotonically and unboundedly. Thus crosses exactly once. Evaluating at confirms , establishing that the root lies in .
Theorem (Bisection Convergence). The bisection method on over converges to 12 decimal places in at most iterations.
Proof. Bisection halves the interval at each step. Starting with width , after steps the width is . For 12-decimal-place accuracy (error ), we need , i.e., . Taking suffices with margin.
Editorial
We else. We enumerate the admissible parameter range, discard candidates that violate the derived bounds or arithmetic constraints, and update the final set or total whenever a candidate passes the acceptance test.
Pseudocode
n = 5000
target = -600000000000
geo = (r^n - 1) / (r - 1)
dge = (n * r^(n+1) - (n+1) * r^n + 1) / (r - 1)^2
Return 900 * geo - 3 * dge
lo = 1.0, hi = 1.01
For i from 1 to 50:
mid = (lo + hi) / 2
If s(mid) > target then
lo = mid
else:
hi = mid
Return mid // rounded to 12 decimal places
Complexity Analysis
- Time: bisection iterations, each requiring arithmetic with the closed-form (or if using direct summation). With the closed form, total time is .
- Space: .
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
// s(r) = sum_{k=1}^{5000} (900 - 3k) * r^{k-1}
// Using closed form:
// s(r) = 900 * (r^5000 - 1)/(r - 1) - 3 * (5000*r^5001 - 5001*r^5000 + 1) / (r-1)^2
// For numerical stability, use direct summation with long double
// or use the closed form carefully.
long double s_func(long double r) {
// Direct summation might lose precision for r near 1 with 5000 terms.
// Use closed form with long double.
long double r5000 = powl(r, 5000);
long double r5001 = r5000 * r;
long double rm1 = r - 1.0L;
long double geo = (r5000 - 1.0L) / rm1;
long double ageo = (5000.0L * r5001 - 5001.0L * r5000 + 1.0L) / (rm1 * rm1);
return 900.0L * geo - 3.0L * ageo;
}
int main() {
long double target = -600000000000.0L;
// Bisection on [1.0, 1.01]
long double lo = 1.0L, hi = 1.01L;
// Verify signs
// s(1.0) is about -33007500, so s(1.0) - target > 0
// s(1.01) should be very negative, so s(1.01) - target < 0
for (int iter = 0; iter < 200; iter++) {
long double mid = (lo + hi) / 2.0L;
long double val = s_func(mid);
if (val > target) {
lo = mid;
} else {
hi = mid;
}
}
printf("%.12Lf\n", lo);
return 0;
}
"""
Problem 235: An Arithmetic Geometric Sequence
Find r (to 12 decimal places) such that
s(r) = sum_{k=1}^{5000} (900 - 3k) * r^{k-1} = -600000000000.
"""
from decimal import Decimal, getcontext
def solve():
getcontext().prec = 50
def s_func(r):
"""Compute s(r) using closed form with Decimal for precision."""
r5000 = r ** 5000
r5001 = r5000 * r
rm1 = r - 1
geo = (r5000 - 1) / rm1
ageo = (5000 * r5001 - 5001 * r5000 + 1) / (rm1 * rm1)
return 900 * geo - 3 * ageo
target = Decimal("-600000000000")
# Bisection
lo = Decimal("1.0")
hi = Decimal("1.01")
for _ in range(200):
mid = (lo + hi) / 2
val = s_func(mid)
if val > target:
lo = mid
else:
hi = mid
# Format to 12 decimal places
result = f"{lo:.12f}"
print(result)
if __name__ == "__main__":
solve()