interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / sum-multiples-of-3-and-5 / wolfram.txt

13 lines · 1254 bytes Raw Blame History
1Wolfram cross-check of tasks/sum-multiples-of-3-and-5/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) = 9c5883ef8e77d0ad2b32028a0c148c15a51a0098504f1ba2b5b79b80c5bad182.
6agreement: YES
7query:
8f[n_] := Sum[k, {k, 0, n - 1, 3}] + Sum[k, {k, 0, n - 1, 5}] - Sum[k, {k, 0, n - 1, 15}];
9s = "by loop, below 1000: " <> ToString[Total[Select[Range[999], Divisible[#, 3] || Divisible[#, 5] &]]] <> "\n" <>
10 StringJoin[Table["by formula, below 10^" <> ToString[e] <> ": " <> ToString[f[10^e]] <> "\n", {e, 1, 9}]];
11{Hash[s, "SHA256", "HexString"], s}
12result:
13Out[1]= {"9c5883ef8e77d0ad2b32028a0c148c15a51a0098504f1ba2b5b79b80c5bad182", "by loop, below 1000: 233168\nby formula, below 10^1: 23\nby formula, below 10^2: 2318\nby formula, below 10^3: 233168\nby formula, below 10^4: 23331668\nby formula, below 10^5: 2333316668\nby formula, below 10^6: 233333166668\nby formula, below 10^7: 23333331666668\nby formula, below 10^8: 2333333316666668\nby formula, below 10^9: 233333333166666668\n"}