Geometric Progression Calculator

.gp-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e4e8; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .gp-calc-header { text-align: center; margin-bottom: 30px; } .gp-calc-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; } .gp-calc-field { flex: 1; min-width: 200px; } .gp-calc-field label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; } .gp-calc-field input { width: 100%; padding: 12px; border: 1.5px solid #ddd; border-radius: 6px; font-size: 16px; box-sizing: border-box; } .gp-calc-field input:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); } .gp-calc-btn { width: 100%; background-color: #007bff; color: white; padding: 15px; border: none; border-radius: 6px; font-size: 18px; font-weight: 700; cursor: pointer; transition: background-color 0.2s; margin-top: 10px; } .gp-calc-btn:hover { background-color: #0056b3; } .gp-calc-results { margin-top: 30px; padding: 20px; background-color: #f8f9fa; border-radius: 8px; display: none; } .gp-calc-result-item { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #dee2e6; } .gp-calc-result-item:last-child { border-bottom: none; } .gp-calc-result-label { font-weight: 600; color: #555; } .gp-calc-result-value { font-size: 20px; font-weight: 700; color: #007bff; display: block; margin-top: 5px; } .gp-article-section { margin-top: 40px; line-height: 1.6; color: #444; } .gp-article-section h2 { color: #222; border-bottom: 2px solid #007bff; padding-bottom: 10px; margin-top: 30px; } .gp-formula-box { background: #f1f4f9; padding: 15px; border-left: 5px solid #007bff; margin: 20px 0; font-family: "Courier New", Courier, monospace; } .error-msg { color: #dc3545; font-weight: bold; display: none; margin-top: 10px; }

Geometric Progression Calculator

Calculate the n-th term, sum of terms, and the infinite sum of a geometric sequence.

Please enter valid numbers for all fields.
The n-th Term (aₙ):
Sum of first n terms (Sₙ):
Sum to Infinity (S∞):
Sequence Preview:

Understanding Geometric Progression (GP)

A Geometric Progression (GP), also known as a geometric sequence, is a sequence of numbers where each term after the first is found by multiplying the previous one by a fixed, non-zero number called the common ratio.

Geometric sequences are prevalent in finance (compound interest), biology (population growth), and physics. Unlike arithmetic progressions where you add a constant, in geometric progressions, you multiply by a constant.

The Geometric Progression Formulas

To calculate specific values within a GP, we use the following mathematical formulas:

1. The n-th Term Formula:
aₙ = a₁ * r^(n-1)

2. Sum of n Terms (Sₙ):
If r ≠ 1: Sₙ = a₁(1 – rⁿ) / (1 – r)
If r = 1: Sₙ = a₁ * n

3. Sum to Infinity (S∞):
Only if |r| < 1: S∞ = a₁ / (1 – r)

Example Calculation

Suppose you have a sequence where the First Term (a₁) is 5 and the Common Ratio (r) is 2. You want to find the 4th term and the sum of the first 4 terms.

  • 4th Term (n=4): a₄ = 5 * 2^(4-1) = 5 * 2³ = 5 * 8 = 40
  • Sum of 4 terms: S₄ = 5(1 – 2⁴) / (1 – 2) = 5(1 – 16) / -1 = 5(-15) / -1 = 75

When is a Geometric Series Convergent?

A geometric series is considered convergent if its common ratio (r) is between -1 and 1 (i.e., |r| < 1). In this case, as you add more and more terms, the sum approaches a finite number. This is the "Sum to Infinity." If |r| ≥ 1, the series is divergent, and the sum will grow toward positive or negative infinity.

Frequently Asked Questions

What happens if the common ratio is negative?
If the common ratio is negative, the terms of the sequence will alternate between positive and negative values. For example, if a₁ = 1 and r = -2, the sequence is 1, -2, 4, -8, 16…

Can the common ratio be 0?
In standard mathematical definitions, the common ratio is usually non-zero, as a ratio of 0 would result in all terms after the first being 0, which doesn't follow the typical geometric growth patterns.

function calculateGP() { var a = parseFloat(document.getElementById('firstTerm').value); var r = parseFloat(document.getElementById('commonRatio').value); var n = parseInt(document.getElementById('numTerms').value); var errorMsg = document.getElementById('errorMsg'); var resultsDiv = document.getElementById('gpResults'); // Validation if (isNaN(a) || isNaN(r) || isNaN(n) || n <= 0) { errorMsg.style.display = 'block'; resultsDiv.style.display = 'none'; return; } errorMsg.style.display = 'none'; // 1. Calculate n-th term var nthTerm = a * Math.pow(r, (n – 1)); // 2. Calculate Sum of n terms var sumN = 0; if (r === 1) { sumN = a * n; } else { sumN = (a * (1 – Math.pow(r, n))) / (1 – r); } // 3. Calculate Sum to Infinity var sumInf = "Divergent (No finite sum)"; if (Math.abs(r) < 1) { var infCalc = a / (1 – r); sumInf = infCalc.toLocaleString(undefined, {maximumFractionDigits: 4}); } // 4. Generate Sequence Preview (up to first 10 terms) var sequenceArr = []; var limit = Math.min(n, 10); for (var i = 0; i 10) { seqString += '…'; } // Display results document.getElementById('nthTermVal').innerText = nthTerm.toLocaleString(undefined, {maximumFractionDigits: 4}); document.getElementById('sumNVal').innerText = sumN.toLocaleString(undefined, {maximumFractionDigits: 4}); document.getElementById('sumInfVal').innerText = sumInf; document.getElementById('sequenceVal').innerText = seqString; resultsDiv.style.display = 'block'; }

Leave a Comment