Math coding challenges

Practise math with 76 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Easy · 37 Medium · 36 Hard · 3

Skills you'll practise: Big number arithmeticPrimality testingCycle detectionDigit sumModular arithmeticRecurrencesSieve of EratosthenesSquare root boundBit shiftsCombinatoricsDigit extractionDigit manipulation
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
245
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

76 challenges
Easy

Harshad Number

Check whether a number is divisible by the sum of its digits (a Harshad or Niven number).

You'll learn Digit sumDivisibility
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Disarium Number

Check whether a number equals the sum of its digits raised to their positions.

You'll learn Digit positionsInteger powers
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Spy Number

Check whether the sum of a number's digits equals the product of its digits.

You'll learn Digit sumDigit product
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Neon Number

Check whether the digit sum of a number's square equals the number.

You'll learn Digit sumSquaring
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet