FAILURE MAP
← Case archive

FA-5571 / Number theory / Open access

Digital root base ten · case 01

A zero remainder represents nine for nonzero multiples.

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

ROOT CAUSE

A zero remainder represents nine for nonzero multiples.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return 0 if n==0 else 1+(abs(n)-1)%9

Unsuccessful approach: One digit sum may still have more than one digit.

Case contract

Integer inputs; n is positive unless a zero or negative fixture explicitly extends that operation. A modulus is greater than one; p is prime; exponent k may be signed when an inverse exists. n is any signed integer; repeatedly sum magnitude digits until one remains, preserving zero. Exact operational definition: 0 if n==0 else 1+(abs(n)-1)%9

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Number theory 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 abs(n)%9
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: (18,)', solve(*(18,)), 9)
check('fixture 3: (999,)', solve(*(999,)), 9)
check('fixture 4: (-29,)', solve(*(-29,)), 2)
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: (0,)00Passed
fixture 2: (18,)09Failed
fixture 3: (999,)09Failed
fixture 4: (-29,)22Passed

SHA-256 / 81d8e791e81eb009777620bf7fff558f7bb5556669e1634686f6a5022d4ebb2d

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 sum(map(int,str(abs(n))))
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: (18,)', solve(*(18,)), 9)
check('fixture 3: (999,)', solve(*(999,)), 9)
check('fixture 4: (-29,)', solve(*(-29,)), 2)
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: (0,)00Passed
fixture 2: (18,)99Passed
fixture 3: (999,)279Failed
fixture 4: (-29,)112Failed

SHA-256 / 1e39318deacafb94afe25c41384d3a74c72cff042bc16ef731a1d26a49d82e03

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 0 if n==0 else 1+(abs(n)-1)%9
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: (18,)', solve(*(18,)), 9)
check('fixture 3: (999,)', solve(*(999,)), 9)
check('fixture 4: (-29,)', solve(*(-29,)), 2)
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: (0,)00Passed
fixture 2: (18,)99Passed
fixture 3: (999,)99Passed
fixture 4: (-29,)22Passed

SHA-256 / afd09070f0fe0463808c10c1e33280ccfe399235d8dd54dd84bf7027da7fe234

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:50.989451+00:00.

Case digest / 1ccdcd847946d23a7a339151cfcd6f12a109a158e47dc209b7a9990def62b0d1