✓
Passing This code compiles and runs correctly.
Code
import std/io
import std/table
// Pin #3: the mod-30030 champion wheel (5,760 residues), verified by its FULL sum.
// Residues coprime to n in [0,n) pair as r and n-r, so sum = n*phi(n)/2 =
// 30030*5760/2 = 86,486,400. This validates every residue, not just the count.
from(wheel30030) { x over 0..30030 | keep gcd(x, 30030) == 1 }
sum(total) { wheel30030 }
std/io:print.ln("{{ total:d }}")
Actual
86486400
Expected output
86486400
Flows
flow ~from click a branch to expand · @labels scroll to their anchor
from (wheel30030, source: x over 0..30030 | keep gcd(x, 30030) == 1)
flow ~sum click a branch to expand · @labels scroll to their anchor
sum (total, source: wheel30030)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "{{ total:d }}")
Test Configuration
MUST_RUN