FAILURE MAP
← Case archive

FA-72541 / Check-digit algorithms / Open access

CUSIP doubles the first character of each pair · case 01

Most CUSIPs are rejected.

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

ROOT CAUSE

Doubling is applied at 0-based even indices (odd 1-based positions).

THE FAILURE

Doubling is applied at 0-based even indices (odd 1-based positions).

Unsuccessful approach: Doubling only numeric characters at the right positions skips letters that must also be doubled.

Case contract

CUSIP check: nine ASCII characters, the ninth a digit. Payload values: digits face value, A-Z 10-35, * 36, @ 37, # 38 (anything else "malformed"). Every second payload character (1-based even position) is doubled, and the decimal digits of each value are summed. Return [(10 - sum % 10) % 10, whether it equals the ninth digit].

Why this case matters

Clearing and custody systems validate North American security identifiers.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    if len(s) != 9 or not s.isascii() or not s[8].isdigit():
        return 'malformed'
    total = 0
    for i, ch in enumerate(s[:8]):
        if ch.isdigit():
            v = int(ch)
        elif 'A' <= ch <= 'Z':
            v = ord(ch) - 55
        elif ch in '*@#':
            v = 36 + '*@#'.index(ch)
        else:
            return 'malformed'
        if i % 2 == 0:
            v *= 2
        total += v // 10 + v % 10
    check = (10 - total % 10) % 10
    return [check, check == int(s[8])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["317997MK3"]', ['317997MK3'], [7, False]], ['regression ["624143L53"]', ['624143L53'], [0, False]], ['partial-repair ["7900294Q7"]', ['7900294Q7'], [2, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["161949AV8"]', ['161949AV8'], [4, False]], ['regression ["907215RM1"]', ['907215RM1'], [1, True]], ['partial-repair ["088857YN7"]', ['088857YN7'], [1, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["462107IA0"]', ['462107IA0'], [3, False]], ['regression ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]], ['partial-repair ["V0SRK56U5"]', ['V0SRK56U5'], [2, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["U243EIXI1"]', ['U243EIXI1'], [4, False]], ['regression ["6PI3M7KT7"]', ['6PI3M7KT7'], [0, False]], ['partial-repair ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['partial-repair ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed']], [['regression ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['regression ["XIXEC2WW3"]', ['XIXEC2WW3'], [7, False]], ['partial-repair ["68389X105"]', ['68389X105'], [5, True]], ['partial-repair ["ZZZZZZZZ0"]', ['ZZZZZZZZ0'], [0, True]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed']]]
for label, args, expected in fixtures[N - 1]:
    check(label, 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 fixtureActualExpectedOutcome
regression ["317997MK3"][3, True][7, False]Failed
regression ["624143L53"][4, False][0, False]Failed
partial-repair ["7900294Q7"][7, True][2, False]Failed
control ["595693682"][0, False][0, False]Passed
control ["445197417"][1, False][1, False]Passed
control ["523003XR4"][7, False][7, False]Passed
control ["03783310"]malformedmalformedPassed
control ["0378331a0"]malformedmalformedPassed

SHA-256 / ab27e007f8ef0d0c05f8230f4f4cb4b5d23a6e268be2f8acce6ab880b7757de2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    if len(s) != 9 or not s.isascii() or not s[8].isdigit():
        return 'malformed'
    total = 0
    for i, ch in enumerate(s[:8]):
        if ch.isdigit():
            v = int(ch)
        elif 'A' <= ch <= 'Z':
            v = ord(ch) - 55
        elif ch in '*@#':
            v = 36 + '*@#'.index(ch)
        else:
            return 'malformed'
        if i % 2 == 1 and ch.isdigit():
            v *= 2
        total += v // 10 + v % 10
    check = (10 - total % 10) % 10
    return [check, check == int(s[8])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["317997MK3"]', ['317997MK3'], [7, False]], ['regression ["624143L53"]', ['624143L53'], [0, False]], ['partial-repair ["7900294Q7"]', ['7900294Q7'], [2, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["161949AV8"]', ['161949AV8'], [4, False]], ['regression ["907215RM1"]', ['907215RM1'], [1, True]], ['partial-repair ["088857YN7"]', ['088857YN7'], [1, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["462107IA0"]', ['462107IA0'], [3, False]], ['regression ["6OZ44LI17"]', ['6OZ44LI17'], [5, False]], ['partial-repair ["V0SRK56U5"]', ['V0SRK56U5'], [2, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed'], ['control ["0378331a0"]', ['0378331a0'], 'malformed']], [['regression ["U243EIXI1"]', ['U243EIXI1'], [4, False]], ['regression ["6PI3M7KT7"]', ['6PI3M7KT7'], [0, False]], ['partial-repair ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['partial-repair ["7WKYMG#Y7"]', ['7WKYMG#Y7'], [3, False]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed']], [['regression ["KU9BYOL70"]', ['KU9BYOL70'], [2, False]], ['regression ["XIXEC2WW3"]', ['XIXEC2WW3'], [7, False]], ['partial-repair ["68389X105"]', ['68389X105'], [5, True]], ['partial-repair ["ZZZZZZZZ0"]', ['ZZZZZZZZ0'], [0, True]], ['control ["595693682"]', ['595693682'], [0, False]], ['control ["445197417"]', ['445197417'], [1, False]], ['control ["523003XR4"]', ['523003XR4'], [7, False]], ['control ["03783310"]', ['03783310'], 'malformed']]]
for label, args, expected in fixtures[N - 1]:
    check(label, 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 fixtureActualExpectedOutcome
regression ["317997MK3"][9, False][7, False]Failed
regression ["624143L53"][0, False][0, False]Passed
partial-repair ["7900294Q7"][1, False][2, False]Failed
control ["595693682"][0, False][0, False]Passed
control ["445197417"][1, False][1, False]Passed
control ["523003XR4"][7, False][7, False]Passed
control ["03783310"]malformedmalformedPassed
control ["0378331a0"]malformedmalformedPassed

SHA-256 / d1ee500a19ab569595811a1b49f1045056d44c2ad10904302003056d710c4ac5

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. 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:48:39.408275+00:00.

Case digest / 2bc69e1c0505f7fe460e89334747f01f9466ed2327dd23f96c848d676e6c235b