FAILURE MAP
← Case archive

FA-5466 / Integer arithmetic / Open access

Geometric integer series · case 01

The next term is confused with the series sum.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The next term is confused with the series sum.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(a*r**i for i in range(n))

Unsuccessful approach: The exponent range omits the initial term and adds one extra term.

Case contract

Integer arguments; denominators, steps, moduli, and bit widths are positive. Unsigned word inputs fit the specified width except where masking is explicitly the operation. Sequence sizes are nonnegative. a and r may be signed; n>=0. Sum a*r**i for i=0..n-1, including the zeroth-power convention. Exact operational definition: sum(a*r**i for i in range(n))

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Integer mathematics results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, r, n):
    return a*r**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 80)
check('fixture 2: (5, 1, 3)', solve(*(5, 1, 3)), 15)
check('fixture 3: (7, 0, 3)', solve(*(7, 0, 3)), 7)
check('fixture 4: (3, 2, 0)', solve(*(3, 2, 0)), 0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: (2, 3, 4)16280Failed
fixture 2: (5, 1, 3)515Failed
fixture 3: (7, 0, 3)07Failed
fixture 4: (3, 2, 0)30Failed

SHA-256 / b28d787be0f898600fa110269aa5418590cf5df586037f2d4217976b108b41e2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, r, n):
    return sum(a*r**i for i in range(1,n+1))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 80)
check('fixture 2: (5, 1, 3)', solve(*(5, 1, 3)), 15)
check('fixture 3: (7, 0, 3)', solve(*(7, 0, 3)), 7)
check('fixture 4: (3, 2, 0)', solve(*(3, 2, 0)), 0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: (2, 3, 4)24080Failed
fixture 2: (5, 1, 3)1515Passed
fixture 3: (7, 0, 3)07Failed
fixture 4: (3, 2, 0)00Passed

SHA-256 / 9b637b4094aa8a1d44ad9b70609bbd23d1f5e0a22c2057c4ebab4b91aae30487

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, r, n):
    return sum(a*r**i for i in range(n))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 80)
check('fixture 2: (5, 1, 3)', solve(*(5, 1, 3)), 15)
check('fixture 3: (7, 0, 3)', solve(*(7, 0, 3)), 7)
check('fixture 4: (3, 2, 0)', solve(*(3, 2, 0)), 0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: (2, 3, 4)8080Passed
fixture 2: (5, 1, 3)1515Passed
fixture 3: (7, 0, 3)77Passed
fixture 4: (3, 2, 0)00Passed

SHA-256 / 5f50c60f9caf271f5c19294d9ecd8a64a7b244d5ea0ace278ada6b849815b16f

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:49.870434+00:00.

Case digest / 38326dcd6917b9fd06ca801e463cbc8ff46f2fdafe11be610bf0a2cfb6397c71