## Total no of 1’s in numbers

Given an integer n, count the total number of digit 1 appearing in all positive integers less than or equal to n. Examples: Input :… Read More »

## Largest number with prime digits

Given a huge integer value n, find the largest integer value x such that x <= n and all the digits of x are prime.… Read More »

## Largest smaller number possible using only one swap operation

Given a non-negative number N in the form of string. The task is to apply at most one swap operation on the number N so… Read More »

## Program to check for ISBN

An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book. The first nine digits of the ISBN… Read More »

## Program to check for Peterson number

A number is said to be a Peterson number if the sum of factorials of each digit of the number is equal to the number… Read More »

## Sum of digits of a given number to a given power

Given a number, we need to find the sum of all the digits of a number which we get after raising the number to a… Read More »

## Number of n digit numbers that do not contain 9

Given a number n, find how many n digit number can be formed that does not contain 9 as it’s digit. Examples: Input : 1… Read More »

## Recursive sum of digits of a number is prime or not

Given a number n, we need to find the sum of each digits of the number till the number becomes a single digit. We need… Read More »

## Check if the product of digit sum and its reverse equals the number or not

Given a number, check whether the product of digit sum and reverse of digit sum equals the number or not. Examples: Input : 1729 Output… Read More »

## Biggest integer which has maximum digit sum in range from 1 to n

Given a number n, find a number in range from 1 to n such that its sum is maximum. If there are several such integers,… Read More »

## LCM of digits of a given number

Given a number n, find LCM of its digits. Examples: Input : 397 Output : 63 LCM of 3, 9 and 7 is 63. Input… Read More »

## Largest number less than N whose each digit is prime number

Given a very large number N (1 <= number of digit in N <= 105). The task is find the largest number X such that… Read More »

## Smallest x such that 1*n, 2*n, … x*n have all digits from 1 to 9

Given a positive number n. We need to find x such that 1*n, 2*n, 3*n…..x*n gives all 10 digits at least once. If no such… Read More »

## Find a number x such that sum of x and its digits is equal to given n.

Given a positive number n. We need to find a number x such that sum of digits of x to itself is equal to n.… Read More »

## Count divisors of n that have at-least one digit common with n

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 »