Number Theory Coding Problems

Prime numbers, GCD, and modular arithmetic

76
Total Problems
11
Easy
33
Medium
32
Hard
Start Practicing
πφgcdmod

Master DSA Topics - January, 2026

Practice problems across 75+ categories

Number Theory Coding Problems

Practice problems frequently asked at Number Theory 76 problems | 11 Easy | 33 Medium | 32 Hard

# Problem Difficulty Topics
16 Count Valid Paths in a Tree Hard
MathDynamic ProgrammingTree
17 Count Ways to Make Array With Product Hard
ArrayMathDynamic Programming
18 Digit Operations to Make Two Integers Equal Medium
MathGraphHeap (Priority Queue)
19 Distinct Prime Factors of Product of Array Medium
ArrayHash TableMath
20 Find Greatest Common Divisor of Array Easy
ArrayMathNumber Theory
21 Find the Count of Numbers Which Are Not Special Medium
ArrayMathNumber Theory
22 Find the Largest Palindrome Divisible by K Hard
MathStringDynamic Programming
23 Find the Maximum Factor Score of Array Medium
ArrayMathNumber Theory
24 Find the Number of Subsequences With Equal GCD Hard
ArrayMathDynamic Programming
25 GCD Sort of an Array Hard
ArrayMathUnion Find
26 Graph Connectivity With Threshold Hard
ArrayMathUnion Find
27 Greatest Common Divisor Traversal Hard
ArrayMathUnion Find
28 Insert Greatest Common Divisors in Linked List Medium
Linked ListMathNumber Theory
29 Kth Smallest Amount With Single Denomination Combination Hard
ArrayMathBinary Search
30 Largest Component Size by Common Factor Hard
ArrayHash TableMath
Showing 16-30 of 76
1 2 3 4 ... 6

Tutorials Library

Master any technology with our largest free online Library. Browse through 500+ tutorials across 10+ categories.

Python

Python Tutorial

Java

Java Tutorial

JavaScript

JavaScript

C++

C++ Tutorial

C#

C# Tutorial

Go

Go Tutorial

Rust

Rust Tutorial

TypeScript

TypeScript

Swift

Swift Tutorial

Kotlin

Kotlin Tutorial

Ruby

Ruby Tutorial

PHP

PHP Tutorial

C

C Tutorial

Scala

Scala Tutorial

Perl

Perl Tutorial

R

R Tutorial

Dart

Dart Tutorial

Lua

Lua Tutorial

MATLAB

MATLAB

Haskell

Haskell

Developer Toolbox

Powerful online tools to boost your productivity

public class MyFirstJavaProgram { Edit & Run

   /* This is my first java program.
    * This will print 'Hello, World!' as the output
    */

   public static void main(String []args) {
      System.out.println("Hello, World!"); // prints
   }
}

Start Coding in Seconds

Coding Ground For Developers

Code, Edit, Run and Share

Ignite your coding potential on Coding Ground - an immersive online platform for hands-on learning, collaboration, and skill development.