Skip to content

Math -> Lucas Theorem And Large Binomial Mod Prime

Prime-mod binomial coefficients beyond one factorial table, using base-p digit decomposition and Lucas theorem when n crosses p.

  • Topic slug: math/lucas-theorem
  • Tutorial page: Open tutorial
  • Ladder page: Open ladder
  • Repo problems currently tagged here: 1
  • Repo companion pages: 3
  • Curated external problems: 2

Microtopics

  • lucas-theorem
  • base-p-digits
  • large-binomial
  • prime-mod-binomial
  • digit-product
  • factorial-table-boundary

Learning Sources

Source Type
cp-algorithms binomial coefficients Reference
AtCoder ABC251 editorial Reference
Competitive Programmer's Handbook Reference

Practice Sources

Source Type
Library Checker Binomial Coefficient (Prime Mod) Practice
Kattis Odd Binomial Coefficients Practice

Repo Companion Material

Material Type
Lucas Theorem hot sheet quick reference
Binomial Coefficient (Prime Mod) flagship note
Template Library exact starter route starter route

Curated External Problems

Core

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
Binomial Coefficient (Prime Mod) Library Checker Medium Binomial Coefficients Math; Implementation Modular Arithmetic; Factorial Binomial; Base Conversion Binomial Coefficient; Prime Modulus A clean benchmark for the route split between one ordinary factorial table and Lucas digit decomposition under one prime modulus.

Stretch

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
Odd Binomial Coefficients Kattis Hard Binomial Coefficients, Pascal Structure Math; Observation Lucas Theorem; Bitwise Reasoning Parity; Bitwise Pattern A strong compare point where Lucas with p = 2 exposes a structural parity pattern instead of only answering one binomial query.

Repo Problems

Code Title Fit Difficulty Pattern Note Solution
BINOMIALCOEFFICIENTPRIMEMOD Binomial Coefficient (Prime Mod) primary medium - Note Code

Regeneration

python3 scripts/generate_problem_catalog.py