Multi-Agent Haiku System Matches Claude Opus on Complex Number Theory Problem at 15x Lower Cost

Experimental Setup and Results
A Reddit user conducted a comparative test between two Claude model configurations on a challenging number theory problem. The problem required proving that for an odd prime p, the sum 1^(p-1) + 2^(p-1) + ... + (p-1)^(p-1) is congruent to -1 (mod p), using Fermat's Little Theorem and properties of primitive roots.
Two configurations were tested:
- Config X (Opus solo): Claude Opus 4.5 with max_tokens: 2048, no auditor
- Config Y (Haiku multi-agent): Haiku generator produces full proof, second Haiku auditor checks every step, with two passes if auditor flags anything, max_tokens: 1024 each call
Scoring and Performance
Both configurations scored 4/4 using this rubric:
- Correctly invokes Fermat's Little Theorem
- Correctly handles primitive root argument
- Summation over complete residue system valid
- Congruence conclusion follows correctly
The Haiku auditor returned VERIFIED with no disagreement. Performance metrics:
- Opus solo: ~8.7 seconds, score 4/4
- Haiku + auditor: ~10.9 seconds, score 4/4
Cost Analysis
The economic implications are significant:
- Opus solo: $0.075/1000 tokens × ~800 tokens = ~$0.06 per query
- Haiku + Haiku: $0.0025/1000 tokens × ~1600 tokens = ~$0.004 per query
This represents approximately 15x lower cost for identical results on this problem. The problem was described as "genuinely hard" and not training-data-obvious like simpler proofs.
The source notes that on clean problems where Fermat's Little Theorem does the heavy lifting (each a^(p-1) ≡ 1, sum (p-1) ones, get p-1 ≡ -1), the auditor pattern adds about a 17% time tax to confirm correctness. The pattern is particularly valuable for problems where the generator might stumble with quantization stutter or hallucinated algebra.
📖 Read the full source: r/ClaudeAI
👀 See Also

AutoBe: How Weak Local LLMs Fixed an AI Backend Generator's Architecture
AutoBe is an open-source AI agent that generates complete backend apps using TypeScript, NestJS, and Prisma. The team discovered their initial 100% compilation success produced unmaintainable code, then rebuilt with modular generation—crashing success to 40%—and used weak local LLMs like qwen3-30b-a3b-thinking to debug schema ambiguities.

SpecLock: MCP Server for Enforcing AI Coding Constraints
SpecLock is an open-source MCP server that remembers project constraints across sessions and blocks AI coding agents from violating them. Claude independently tested it with 100 adversarial tests, scoring 100/100 with zero false positives and 15.7ms per check.

Toothcomb: Open-Source Real-Time Speech Fact-Checker Built with Claude Opus and Sonnet APIs
Toothcomb is an open-source tool that takes a speech transcript, fact-checks claims, detects logical fallacies and manipulative language using Claude Opus API, and supports real-time microphone streaming.

Claude Code Adds Multi-Agent Code Review System
Anthropic has launched Code Review for Claude Code, a multi-agent system that dispatches teams of AI agents to review pull requests. The system catches bugs human reviewers often miss, with 54% of PRs now getting substantive review comments compared to 16% before.