FA-5456 / Integer arithmetic / Open access
Sum first cubes · case 01
The square-sum identity is reused for cubes.
ROOT CAUSE
The square-sum identity is reused for cubes.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return (n*(n+1)//2)**2
Unsuccessful approach: The terminal cube replaces the accumulated series.
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. Return sum(i**3 for i from 1 through n), with n nonnegative. Exact operational definition: (n*(n+1)//2)**2
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(n):
return n*(n+1)*(2*n+1)//6
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 36)
check('fixture 4: (5,)', solve(*(5,)), 225)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (0,) | 0 | 0 | Passed |
| fixture 2: (1,) | 1 | 1 | Passed |
| fixture 3: (3,) | 14 | 36 | Failed |
| fixture 4: (5,) | 55 | 225 | Failed |
SHA-256 / d7311049553e5b8f43c9d59933ee5f5f88fbe6d130594dd36877099d575e7814
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(n):
return n**3
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 36)
check('fixture 4: (5,)', solve(*(5,)), 225)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (0,) | 0 | 0 | Passed |
| fixture 2: (1,) | 1 | 1 | Passed |
| fixture 3: (3,) | 27 | 36 | Failed |
| fixture 4: (5,) | 125 | 225 | Failed |
SHA-256 / 4d52d9ab99c778ec57ce95e06e40f29a4593c148428032490291d30ba1677808
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(n):
return (n*(n+1)//2)**2
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 36)
check('fixture 4: (5,)', solve(*(5,)), 225)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (0,) | 0 | 0 | Passed |
| fixture 2: (1,) | 1 | 1 | Passed |
| fixture 3: (3,) | 36 | 36 | Passed |
| fixture 4: (5,) | 225 | 225 | Passed |
SHA-256 / 005184deb0a105e61aaae028ed2807bca7ddcaa5591b0a5c12f57e3465a908d6
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.692600+00:00.
Case digest / be27f97fd05061ca4c88c96b6fa322faaedc668c12c66b6970e1346710adf4e7