Tag Archives: divisibility

Sum of all numbers divisible by 6 in a given rangeNovember 14, 2017

Given a range L-R, find the sum of all numbers divisible by 6 in range L-R L and R are very large. Examples: Input :… Read More »

Given a large number, check if a subsequence of digits is divisible by 8November 13, 2017

Given a number of at most 100 digits. We have to check if it is possible, after removing certain digits, to obtain a number of… Read More »

Print digit’s position to be removed to make a number divisible by 6November 10, 2017

Given a number N, remove exactly one digit to make the number divisible by 6 (make it the largest possible). Print the position that has… Read More »

Program to find remainder when large number is divided by 11November 9, 2017

Given a number n, the task is to find the remainder when n is divided by 11. The input of number may be very large.… Read More »

Number of digits to be removed to make a number divisible by 3November 8, 2017

Given a very large number num (1 <= num <= 10^1000), print the number of digits that needs to be removed to make the number… Read More »

Divisibility by 64 with removal of bits allowedNovember 5, 2017

Given a binary string, we need to check whether that number is divisible by 64 or not after removing of some bits. If yes then… Read More »

Subsequences of size three in an array whose sum is divisible by mNovember 3, 2017

Given an array A[] (1

Check if a large number is divisibility by 15November 2, 2017

Given a very large number. Check its divisibility by 15. Examples: Input: 31 Output: No Input : num = “156457463274623847239840239 402394085458848462385346236 482374823647643742374523747 264723762374620” Output: Yes… Read More »

Divisible by 37 for large numbersOctober 23, 2017

Given a large number n, we need to check whether it is divisible by 37. Print true if it is divisible by 37 otherwise False.… Read More »

Print k numbers where all pairs are divisible by mOctober 19, 2017

Given an integer array and two numbers k and m. Print k numbers from the array, such that difference between any two pairs is divisible… Read More »

Count divisors of n that have at-least one digit common with nOctober 16, 2017

Given an number n, find the number of divisors whose at least one digit in the decimal representation matches with the number n. Examples: Input… Read More »

Divide number into two parts divisible by given numbersOctober 15, 2017

Given a large number in string format and we are also given two numbers f and s. We need to divide the large number into… Read More »

Queries for counts of multiples in an arrayOctober 5, 2017

Given an array of positive integers and many queries for divisibility. In every query, we are given an integer k ( > 0), we need… Read More »

Decimal representation of given binary string is divisible by 10 or notOctober 2, 2017

The problem is to check whether the decimal representation of the given binary number is divisible by 10 or not. Take care, the number could… Read More »

To check whether a large number is divisible by 7October 1, 2017

You are given an n-digit large number, you have to check whether it is divisible by 7. A (r+1)-digit integer n whose digital form is… Read More »