FA-15566 / Numerics / Open access
Prime power unit factorial: prime power ring modulus · case 01
The exact prime power unit factorial result violates the stated contract at prime power ring modulus.
ROOT CAUSE
The prime power ring modulus step uses p*e instead of p**e.
VERIFIED REPAIR
Use p**e at the prime power ring modulus step.
Unsuccessful approach: The partial repair p still violates the prime power ring modulus invariant.
Case contract
Input [n,p,e], n>=0 p prime e>=1; return product of positive integers<=n after removing ALL p factors from each, modulo p^e. Bounds: n<=64.
Why this case matters
Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
n,p,e=x;mod=p*e;r=1
for v in range(1,n+1):
for _ in range(30):
if v%p!=0:break
v//=p
r=r*v%mod
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([5, 2, 3], 7), ([3, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([0, 2, 2], 1), ([0, 2, 3], 1), ([0, 2, 4], 1), ([1, 2, 1], 1)], [([5, 2, 4], 15), ([4, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([4, 2, 3], 3), ([4, 2, 4], 3), ([5, 2, 1], 1), ([5, 2, 2], 3)], [([6, 2, 3], 5), ([5, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([8, 2, 3], 3), ([8, 2, 4], 11), ([9, 2, 1], 1), ([9, 2, 2], 3)], [([6, 2, 4], 13), ([6, 2, 3], 5), ([0, 2, 1], 1), ([64, 7, 4], 282), ([12, 2, 4], 15), ([13, 2, 1], 1), ([13, 2, 2], 3), ([13, 2, 3], 3)], [([7, 2, 4], 11), ([7, 2, 3], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([17, 2, 1], 1), ([17, 2, 2], 3), ([17, 2, 3], 3), ([17, 2, 4], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | 3 | 7 | Failed |
| explicit oracle 1 | 3 | 3 | Passed |
| explicit oracle 2 | 1 | 1 | Passed |
| explicit oracle 3 | 16 | 282 | Failed |
| explicit oracle 4 | 1 | 1 | Passed |
| explicit oracle 5 | 1 | 1 | Passed |
| explicit oracle 6 | 1 | 1 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / 96df5e4c3e0014ea7aee2649516bccded3845e10bd5b22762acf41de014083bb
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
n,p,e=x;mod=p;r=1
for v in range(1,n+1):
for _ in range(30):
if v%p!=0:break
v//=p
r=r*v%mod
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([5, 2, 3], 7), ([3, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([0, 2, 2], 1), ([0, 2, 3], 1), ([0, 2, 4], 1), ([1, 2, 1], 1)], [([5, 2, 4], 15), ([4, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([4, 2, 3], 3), ([4, 2, 4], 3), ([5, 2, 1], 1), ([5, 2, 2], 3)], [([6, 2, 3], 5), ([5, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([8, 2, 3], 3), ([8, 2, 4], 11), ([9, 2, 1], 1), ([9, 2, 2], 3)], [([6, 2, 4], 13), ([6, 2, 3], 5), ([0, 2, 1], 1), ([64, 7, 4], 282), ([12, 2, 4], 15), ([13, 2, 1], 1), ([13, 2, 2], 3), ([13, 2, 3], 3)], [([7, 2, 4], 11), ([7, 2, 3], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([17, 2, 1], 1), ([17, 2, 2], 3), ([17, 2, 3], 3), ([17, 2, 4], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | 1 | 7 | Failed |
| explicit oracle 1 | 1 | 3 | Failed |
| explicit oracle 2 | 1 | 1 | Passed |
| explicit oracle 3 | 2 | 282 | Failed |
| explicit oracle 4 | 1 | 1 | Passed |
| explicit oracle 5 | 1 | 1 | Passed |
| explicit oracle 6 | 1 | 1 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / 7738832c7c4fd0b34f9d35cc8978abe35e6029e1a14311502d965db50bb097e4
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
n,p,e=x;mod=p**e;r=1
for v in range(1,n+1):
for _ in range(30):
if v%p!=0:break
v//=p
r=r*v%mod
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([5, 2, 3], 7), ([3, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([0, 2, 2], 1), ([0, 2, 3], 1), ([0, 2, 4], 1), ([1, 2, 1], 1)], [([5, 2, 4], 15), ([4, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([4, 2, 3], 3), ([4, 2, 4], 3), ([5, 2, 1], 1), ([5, 2, 2], 3)], [([6, 2, 3], 5), ([5, 2, 2], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([8, 2, 3], 3), ([8, 2, 4], 11), ([9, 2, 1], 1), ([9, 2, 2], 3)], [([6, 2, 4], 13), ([6, 2, 3], 5), ([0, 2, 1], 1), ([64, 7, 4], 282), ([12, 2, 4], 15), ([13, 2, 1], 1), ([13, 2, 2], 3), ([13, 2, 3], 3)], [([7, 2, 4], 11), ([7, 2, 3], 3), ([0, 2, 1], 1), ([64, 7, 4], 282), ([17, 2, 1], 1), ([17, 2, 2], 3), ([17, 2, 3], 3), ([17, 2, 4], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | 7 | 7 | Passed |
| explicit oracle 1 | 3 | 3 | Passed |
| explicit oracle 2 | 1 | 1 | Passed |
| explicit oracle 3 | 282 | 282 | Passed |
| explicit oracle 4 | 1 | 1 | Passed |
| explicit oracle 5 | 1 | 1 | Passed |
| explicit oracle 6 | 1 | 1 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / 62f44b381b7f48f7b36aaeaf45993778b09b5ebdfdbef9739e60c1f4a37c330b
Verification & scope
A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:39:28.094233+00:00.
Case digest / 647c450fb8c7d23bdb1febcba62f960084a8652f4e3e284d8b98697d3bf57f50