Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

modular exponentiation

Computing a^b \bmod n -- raising a to the power b and reducing mod n, typically by squaring and reducing repeatedly rather than forming the full power first.

Loading interactive…

Examples

  • Computing 3^{20} \bmod 8 by repeated squaring, rather than forming 3^{20} first.

Read the full section →
Graph settings

Calculator