# Tag Archives: number-theory

Given three positive integers A, B, and N, which represent a linear congruence of the form AX=B (mod N), the task is to print all… Read More
Given a range L to R, the task is to find the maximum possible value of GCD(X, Y) such that X and Y belongs to… Read More
Given an integer array A[] of size N, the task is to find the prime numbers just less and just greater than A[i] (for all… Read More
Given a positive even integer N, the task is to find the number of pairs (i, j) from the range [1, N] such that the… Read More
Given two arrays A[] and B[], both consisting of N positive integers, an integer P and the elements of the array A[] are pairwise co-prime, the… Read More
-Given two positive integers N and X, the task is to count the occurrences of the given integer X in an N-length square matrix generated… Read More
Given two positive integers N and X, the task is to count the occurrences of the given integer X in an N-length square matrix generated… Read More
Given a number N, the task is to count the minimum number of digits to be removed from N to make it divisible by 4.… Read More
Given an array arr[] of size N, the task is to find the number of non-empty subsets present in the array such that every element(… Read More
Given an array arr[] consisting of N integers, the task is to count the number of integers in the range [1, arr[i]] that does not… Read More
Given an array arr[] consisting of N integers, the task is to find the integers whose digits are anagrams of each other and print the… Read More
Given an array arr[] of size N, the task is to maximize the count of distinct array elements by repeatedly inserting the absolute difference between… Read More
Given a list arr[] consisting of arrays of varying lengths, the task is to find the maximum product that can be formed by taking exactly… Read More
Given two positive integers N and X, the task is to find the smallest divisor of N which is closest to X. Examples: Input: N… Read More
Given an integer N, the task is to partition the squares of first N( always a multiple of 8 ) natural numbers into two sets… Read More