interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / modular-inverse / wolfram.txt

13 lines · 1015 bytes Raw Blame History
1Wolfram cross-check of tasks/modular-inverse/expected.txt
2tool: WolframLanguageEvaluator (Wolfram MCP, https://agenttools.wolfram.com/mcp), 2026-10-27
3The query builds the task's whole output text from Wolfram built-ins, independently of omc and
4of oracle.py, and returns {SHA-256 of that text, the text}. It agrees when that SHA-256 equals
5sha256(expected.txt) = 2e2ac024552d3fce2543857498e730266f278d60f824c1758ffae7b669ac978d.
6agreement: YES
7query:
8f[{a_, m_}] := With[{g = GCD[a, m]}, ToString[a] <> "^-1 mod " <> ToString[m] <>
9 If[g == 1, " = " <> ToString[If[m == 1, 0, ModularInverse[a, m]]] <> "\n", " does not exist\n"]];
10s = StringJoin[f /@ {{42, 2017}, {40, 1}, {52, 217}, {-486, 217}, {40, 2018}, {1234567, 1000000007}}];
11{Hash[s, "SHA256", "HexString"], s}
12result:
13Out[1]= {"2e2ac024552d3fce2543857498e730266f278d60f824c1758ffae7b669ac978d", "42^-1 mod 2017 = 1969\n40^-1 mod 1 = 0\n52^-1 mod 217 = 96\n-486^-1 mod 217 = 121\n40^-1 mod 2018 does not exist\n1234567^-1 mod 1000000007 = 989145189\n"}