MathsReadCompetitive mathematics

Algorithmic mathematics

50 original programming-style mathematics puzzles in number theory, digit algorithms, combinatorics, dynamic programming, paths and geometry. Solve using any method; submit only the final integer, not code.

50 active competition problems in this category. Select Load more problems to see the next set.

Start with the technique

Translate a large enumeration into states, invariants or periodic blocks.

Worked example

Count numbers in 1 through 34 that are congruent to 2 modulo 5.

Reasoning and solution

The valid values form 2,7,12,…,32. The last multiplier is floor((34−2)/5)=6, so including multiplier zero gives 7 numbers. This avoids testing every number and scales to much larger limits.

Learn modular cycles →

Try the challenges below using the same ideas. You can read them without signing in.

Algorithmic mathematics problems

Showing 1–12 of 50

← All mathematics categories