Math and Number Theory coding problems
Math problems in coding rounds: primes, GCD and LCM, digit tricks, modular arithmetic and counting. Short to write, easy to get wrong on edge cases.
36 problems: 17 easy, 14 medium, 5 hard. Free to read; a free account solves them and earns XP and Aura.
- Count DigitsPractice · +10 XP · recursion, matheasy
- Count DivisorsPractice · +10 XP · basics, loops, arithmeticeasy
- Count Elements Greater Than AveragePractice · +10 XP · basics, loops, arithmeticeasy
- Count MultiplesPractice · +10 XP · binary search, matheasy
- Count Multiples of KPractice · +10 XP · dynamic programming, iteration, number theoryeasy
- Count Perfect SquaresPractice · +10 XP · math, loopseasy
- Number of DivisorsPractice · +10 XP · math, number theoryeasy
- Print Digits of a NumberPractice · +10 XP · basics, loops, arithmeticeasy
- Print Nth Fibonacci NumberPractice · +10 XP · basics, loops, arithmeticeasy
- Recursive FactorialPractice · +10 XP · recursion, matheasy
- Reverse DigitsPractice · +10 XP · math, digitseasy
- Sum of DigitsPractice · +10 XP · recursion, arithmeticeasy
- Sum of DivisorsPractice · +10 XP · math, number theoryeasy
- Sum of Even NumbersPractice · +10 XP · basics, loops, arithmeticeasy
- Sum of Multiples of Three and FivePractice · +10 XP · math, loops, divisibilityeasy
- Sum of Odd DigitsPractice · +10 XP · math, digits, loopseasy
- Sum of Proper DivisorsPractice · +10 XP · math, number theoryeasy
- Count Distinct Prefix SumsPractice · +20 XP · math, prefix sums, hashingmedium
- Count Pairs with Digit Sum Divisible by KPractice · +20 XP · math, hashing, prefix sumsmedium
- Count Pairs with Equal Digit GCDPractice · +20 XP · math, number theory, arraysmedium
- Count Pairs with Equal Digit ProductPractice · +20 XP · math, hashing, number theorymedium
- Count Pairs with Equal Digit SumPractice · +20 XP · math, hashing, arraysmedium
- Count Pairs with Sum Divisible by KPractice · +20 XP · arrays, hashing, number theorymedium
- Distinct Prime FactorsPractice · +20 XP · math, number theory, primesmedium
- Divisible by Last DigitPractice · +20 XP · math, number theory, hash mapmedium
- Pairs with Common FactorPractice · +20 XP · math, number theory, prime factorizationmedium
- Pairs with Same ParityPractice · +20 XP · sorting, two pointers, combinatoricsmedium
- Pairs with Sum Divisible by KPractice · +20 XP · math, number theory, hash mapmedium
- Subarray Digit SumsPractice · +20 XP · math, prefix sums, arraysmedium
- Subarray Sum MultiplesPractice · +20 XP · prefix sums, hash maps, number theorymedium
- Two Sum Modulo KPractice · +20 XP · math, hashing, number theorymedium
- Array Transformation with GCDPractice · +30 XP · math, number theory, gcdhard
- Distinct Subarrays with Bounded SumPractice · +30 XP · two pointers, hash map, combinatoricshard
- GCD of SubarraysPractice · +30 XP · math, number theory, gcdhard
- Prefix Sums and ParityPractice · +30 XP · prefix sums, parity, combinatoricshard
- The Harmonious SequenceOpen now · Monthly · +150 XP · +50 Aura · math, number theory, dynamic programming2 solvedhard
Solve these free. Get paid in XP and Aura.
One tap with Google, no card. Every first accepted solve pays XP for the leaderboards and Aura for real goodies.
Other topics
Hash Map and Hashing101Arrays88Prefix Sums64SQL and Databases64Beginner Coding Problems60Graphs, BFS and DFS45Greedy41Sliding Window39Dynamic Programming37Sorting36Strings35Two Pointers35Stack29Binary Search25Simulation25Recursion22Linked List20Trees20Heap and Priority Queue18Matrix and Grid18Bit Manipulation18Queue and Deque16