Practice Problems on Number Theory

Similar Reads

What is Number Theory?

Number theory is a branch of pure mathematics that deals with the properties and relationships of numbers, particularly integers. It explores the fundamental nature of numbers and their mathematical structures. Number theory has been studied for centuries and has deep connections with various areas of mathematics, including algebra, analysis, and geometry....

Basics of Number Theory:

Find the GCD of two number Find the LCM of two number Calculate the Factorial of a number Program to find Prime factors of a number Find Binomial Coefficient C(n, k) Program to find nth Catalan numbers  Euclid’s Lemma Basic and Extended Euclidean algorithms...

Modular Arithmetic:

Euler’s Totient Function Euler’s Totient function for all numbers smaller than or equal to n Modular Exponentiation (Power in Modular Arithmetic) Find the remainder without using the modulo operator Modular multiplicative inverse Multiplicative order Compute nCr % p using Dynamic Programming Solution Lucas Theorem Compute nCr % p using Lucas Theorem Compute nCr % p using Fermat Little Theorem Fermat Little Theorem. Chinese Remainder Theorem Chinese Remainder Theorem using Inverse Modulo-based Implementation Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3) Find Square Root under Modulo p | Set 2 (Shanks Tonelli algorithm) Modular Division Cyclic Redundancy Check and Modulo-2 Division Find primitive root of a prime number n modulo n Euler’s criterion (Check if square root under modulo p exists) Combine Modular equations using the Chinese Remainder Theorem Multiply large integers under large modulo Compute n! under modulo p Wilson’s Theorem...

Number Theory:

Primality Test to check if a number is prime or not Primality Test to check if a number is prime or not using Fermat Method Primality Test to check if a number is prime or not using Miller–Rabin Primality Test to check if a number is prime or not using Solovay-Strassen Legendre’s formula (Given p and n, find the largest x such that p^x divides n!) Find if a number is Carmichael Numbers Find all generators of cyclic additive group under modulo n Sum of divisors of factorial of a number Fermat Number Sieve of Eratosthenes Goldbach’s Conjecture Pollard’s Rho Algorithm for Prime Factorization...

Game Theory:

Minimax algorithm Nim Game problem Sprague – Grundy Theorem...

Practice Problems on Number Theory:

Problems Searching for Patterns | Set 3 (Rabin-Karp Algorithm) Measure one litre using two vessels and infinite water supply Program to find last digit of n’th Fibonnaci Number GCD of two numbers when one of them can be very large Find Last Digit Of a^b for Large Numbers Remainder with 7 for large numbers Find (a^b)%m where ‘a’ is very large Find sum of modulo K of first N natural number Count all sub-arrays having sum divisible by k Partition a number into two divisble parts Find power of power under mod of a prime Rearrange an array in maximum minimum form | Set 2 (O(1) extra space) Subset with no pair sum divisible by K Number of substrings divisible by 6 in a string of integers...

Miscellaneous Practice Problems on Number Theory:

Problems How to compute mod of a big number? BigInteger Class in Java Modulo 10^9+7 (1000000007) How to avoid overflow in modular multiplication? RSA Algorithm in Cryptography...