demo math

Factor this 100-Digit Semiprime

posted by DarshanSathiya · 4 weeks ago

Demo problem. Any price shown here is fake — nothing is owed and nothing is paid. It exists so you can try the full post → verify → solve → trade → settle loop yourself.

The number below is a semiprime, meaning it's the product of exactly two prime numbers. Your challenge is to find both of them.

5937250637368349781766237876001263246805884479062587124771216795647416252362582570739074931676402993

Verifiers (1)

Author a verifier
semiprime100_factorization_verifier active by DarshanSathiya · 10% commission · 10 s / 256 MB · Python
"""Verifier: factorization of the 100-digit semiprime challenge number.
 
Solution format: the two prime factors as plain base-10 integers (ASCII digits only,
no sign, no leading zeros), separated by a single comma and/or whitespace, in either
order. Example layout: "<p>,<q>" or "<p> <q>". Surrounding whitespace is ignored.
 
Accepted iff both values are integers with 1 < p, q < N, p * q == N exactly, both p
and q pass Miller-Rabin primality testing (fixed prime bases plus random bases drawn
from rng), and the SHA-256 of the smaller factor's decimal string matches the
published commitment.
 
Recommended budget: 5 s / 64 MB (standard library only; runs in milliseconds).
"""
import hashlib
import re
 
_N = int(
    "5937250637368349781766237876001263246805884479062587124771216795647416252362582570739074931676402993"
)
_COMMITMENT = "bfc3cb86ea2392001e70bf76ecfeab652c518c093e0d34e9fbcd6113ea506fca"
_PATTERN = re.compile(r"\A([1-9][0-9]{0,99})(?:\s*,\s*|\s+)([1-9][0-9]{0,99})\Z")
_FIXED_BASES = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71)
 
 
def _miller_rabin(n: int, bases) -> bool:
    if n < 2:
        return False
    for sp in _FIXED_BASES:
        if n == sp:
            return True
        if n % sp == 0:
            return False
    d = n - 1
    s = 0
    while d % 2 == 0:
        d //= 2
        s += 1
    for a in bases:
        a = a % n
        if a < 2:
            a += 2
        x = pow(a, d, n)
        if x == 1 or x == n - 1:
            continue
        for _ in range(s - 1):
            x = pow(x, 2, n)
            if x == n - 1:
                break
        else:
            return False
    return True
 
 
def verify(solution: str, rng) -> bool:
    try:
        if not isinstance(solution, str):
            return False
        if len(solution) > 1024:
            return False
        m = _PATTERN.match(solution.strip())
        if m is None:
            return False
        p = int(m.group(1))
        q = int(m.group(2))
 
        if not (1 < p < _N and 1 < q < _N):
            return False
        if p * q != _N:
            return False
 
        small = min(p, q)
        if hashlib.sha256(str(small).encode("ascii")).hexdigest() != _COMMITMENT:
            return False
 
        rand_bases = [int(x) for x in rng.integers(2, 2**62, size=16)]
        bases = list(_FIXED_BASES) + rand_bases
        if not _miller_rabin(p, bases):
            return False
        if not _miller_rabin(q, bases):
            return False
 
        return True
    except Exception:
        return False
Log in to submit a solution

Verified solutions (1)

🔒 held by Darshan · verified by semiprime100_factorization_verifier · 2026-09-22 ask €1,000 sealed — a bid at or above the ask unlocks it

Order book

book · semiprime100_factorization_verifier
0 current bid €350 ask €1,000
bids (2)
€350until 2026-10-27 17:25 ↻
€10until 2026-10-27 17:17 ↻
asks (1)
€1,000Darshan
unattached demand never crosses until pointed at a verifier
bids (2)
€1,000until 2026-10-27 17:18 ↻
€350until 2026-10-27 17:24 ↻
asks (0)
no asks

Price history

Comments (0)

No comments yet.