Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopnumber-theory · modular-arithmetic · prime-factorization
The organizer’s problem statement is available at the official source link.
residue wheel
Mark residues that contain a prime
A residue m is good when some prime p has p mod N=m; sum each good residue once.
| Prime p | Residue m | Decision |
|---|---|---|
| p mod N | m | mark if a prime p has this residue |
| all m from 0 to N-1 | good residues | sum m |
- 1
Make residue buckets
Make one bucket for each remainder 0…N−1. - 2
Identify prime classes
Use N’s supplied prime factorization to characterize prime-possible remainders. - 3
Sum valid remainders
Sum the marked remainder values.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.