FA-5531 / Number theory / Open access
Trailing factorial zeroes · case 01
Only one factor of five per multiple is counted.
ROOT CAUSE
Only one factor of five per multiple is counted.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(n//(5**i) for i in range(1,n.bit_length()+1))
Unsuccessful approach: Testing whether n itself is divisible ignores factors in preceding terms.
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>=0. Return the number of trailing base-ten zero digits in n!. Exact operational definition: sum(n//(5**i) for i in range(1,n.bit_length()+1))
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 n//5
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: (5,)', solve(*(5,)), 1)
check('fixture 3: (25,)', solve(*(25,)), 6)
check('fixture 4: (100,)', solve(*(100,)), 24)
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: (5,) | 1 | 1 | Passed |
| fixture 3: (25,) | 5 | 6 | Failed |
| fixture 4: (100,) | 20 | 24 | Failed |
SHA-256 / 25b782e337165a7a028c80b4bf3ede28f08a7e26ff090ec3edb88919cb96bfa6
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(n%(5**i)==0 for i in range(1,n.bit_length()+1))
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: (5,)', solve(*(5,)), 1)
check('fixture 3: (25,)', solve(*(25,)), 6)
check('fixture 4: (100,)', solve(*(100,)), 24)
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: (5,) | 1 | 1 | Passed |
| fixture 3: (25,) | 2 | 6 | Failed |
| fixture 4: (100,) | 2 | 24 | Failed |
SHA-256 / 648998c2a70f3a5515cb0b9746376e4fbad4ed0d7cca196bc120b462ad533a95
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 sum(n//(5**i) for i in range(1,n.bit_length()+1))
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: (5,)', solve(*(5,)), 1)
check('fixture 3: (25,)', solve(*(25,)), 6)
check('fixture 4: (100,)', solve(*(100,)), 24)
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: (5,) | 1 | 1 | Passed |
| fixture 3: (25,) | 6 | 6 | Passed |
| fixture 4: (100,) | 24 | 24 | Passed |
SHA-256 / b97651b939d6bb1adaeeb0589b14cfc74ba8e6c6efc8c8e10ae2d0f21370f0f2
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.568561+00:00.
Case digest / ec352940b74310803c05a820ae9b663c81d92af31c35342dd59bdf718bd6422b