Given an integer array arr[] of N integers, the task is to make each adjacent pair in the array co prime, by adding minimum number of… Read More

# Tag Archives: number-theory

Given two large integers in form of strings A and B and their product also in form of string C such that one digit of… Read More

Given three positive integers K, X, and Y, the task is to find the number formed by alternatively subtracting X and adding Y to 0… Read More

Count of numbers in range [L, R] having sum of digits of its square equal to square of sum of digits

Given two integers L and R, the task is to find the count of numbers in range [L, R] such that the sum of digits… Read More

Find Kth lexicographical ordered numeric string of length N with distinct products of each substring

Given two integers N and K, the task is to find the Kth lexicographical ordered string of length N, which has distinct products of each… Read More

Given an array arr[] of N integers, the task is to find the number of unordered pairs (i, j) in the array such that the… Read More

Given an integer N, find a prime number S such that all digits of N occur in a contiguous sequence. There may be multiple answers.… Read More

Given an integer X, D and T, the task is to check if it is possible to reduce X to 0 in exactly T moves.… Read More

Given a range from L to R and an integer K, the task is to count the number of integers in the given range such… Read More

Given an array arr[] consisting of N positive integers and a positive integer X, the task is to find the subset of the given array… Read More

Given two positive integers N and K, the task is to find the number of pairs (a, b) over the range [1, N] such that… Read More

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