FAILURE MAP
← Case archive

FA-5521 / Number theory / Open access

Prime factor multiplicity · case 01

Distinct prime divisors discard their multiplicities.

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

ROOT CAUSE

Distinct prime divisors discard their multiplicities.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: out=[] d=2 while d*d<=n: while n%d==0: out.append(d) n//=d d+=1 if n>1: out.append(n) return out

Unsuccessful approach: Listing proper divisors admits composites and loses prime inputs.

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. Prime factor multiplicity. Exact operational definition: out=[] d=2 while d*d<=n: while n%d==0: out.append(d) n//=d d+=1 if n>1: out.append(n) return out

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 [d for d in range(2,n+1) if n%d==0 and all(d%k for k in range(2,math.isqrt(d)+1))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1,)', solve(*(1,)), [])
check('fixture 2: (12,)', solve(*(12,)), [2, 2, 3])
check('fixture 3: (13,)', solve(*(13,)), [13])
check('fixture 4: (8,)', solve(*(8,)), [2, 2, 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: (1,)[][]Passed
fixture 2: (12,)[2, 3][2, 2, 3]Failed
fixture 3: (13,)[13][13]Passed
fixture 4: (8,)[2][2, 2, 2]Failed

SHA-256 / cf1218a8207cd162fbbf67bbaebee26736f20f704dbf1efb7eda6a68365fbd5a

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 [d for d in range(2,n) if n%d==0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1,)', solve(*(1,)), [])
check('fixture 2: (12,)', solve(*(12,)), [2, 2, 3])
check('fixture 3: (13,)', solve(*(13,)), [13])
check('fixture 4: (8,)', solve(*(8,)), [2, 2, 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: (1,)[][]Passed
fixture 2: (12,)[2, 3, 4, 6][2, 2, 3]Failed
fixture 3: (13,)[][13]Failed
fixture 4: (8,)[2, 4][2, 2, 2]Failed

SHA-256 / 61243118e349e47abb25cbf0a6da330e6f9b61924a392eca8bbd86b6b5bbcab7

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):
    out=[]
    d=2
    while d*d<=n:
        while n%d==0:
            out.append(d)
            n//=d
        d+=1
    if n>1: out.append(n)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1,)', solve(*(1,)), [])
check('fixture 2: (12,)', solve(*(12,)), [2, 2, 3])
check('fixture 3: (13,)', solve(*(13,)), [13])
check('fixture 4: (8,)', solve(*(8,)), [2, 2, 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: (1,)[][]Passed
fixture 2: (12,)[2, 2, 3][2, 2, 3]Passed
fixture 3: (13,)[13][13]Passed
fixture 4: (8,)[2, 2, 2][2, 2, 2]Passed

SHA-256 / 5922a0b844d3d9a93f848a68b0dfc0d54a6b410711fa3c1c0cda9620889e7897

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

Case digest / bbe080d80423db264bac9b5f5e258ece8bd62839728e7fa50aaed7764c856e20