# Tag Archives: number-digits

## Largest number less than N whose each digit is prime numberOctober 19, 2017

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.October 18, 2017

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 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 »

## Vampire NumberOctober 12, 2017

Introduction to Vampire Number and its implementation using python. Introduction In mathematics, a vampire number (or true vampire number) is a composite natural number v,… Read More »

## Count of numbers satisfying m + sum(m) + sum(sum(m)) = N

Given an integer N, find out the count of numbers(m) that satisfy the condition m + sum(m) + sum (sum(m)) = N, where sum(m) denotes… Read More »

## Minimal operations to make a number magicalOctober 11, 2017

Given a 6 digit number, calculate the minimum number of digits that needs to be replaced in order to make the number magical. The number… Read More »

## Spy Number (Sum and Products of Digits are same)October 7, 2017

A number is said to be a Spy number if the sum of all the digits is equal to the product of all digits. Examples:… Read More »

## Generate all cyclic permutations of a numberOctober 6, 2017

Given a number N, our task is to generate all the possible cyclic permutations of the number. A cyclic permutation shifts all the elements of… Read More »

## Next higher palindromic number using the same set of digitsOctober 4, 2017

Given a palindromic number num having n number of digits. The problem is to find the smallest palindromic number greater than num using the same… Read More »

## Program to count digits in an integer (3 Different Methods)October 2, 2017

Count the number of digits in a long integer entered by a user. Recommended: Please try your approach on {IDE} first, before moving on to… Read More »

## Digit – Product – SequenceSeptember 27, 2017

Given a number N, the task is to print the sequence upto N. The sequence is : 1, 2, 4, 8, 16, 22, 26, 38,… Read More »

## Next higher number using atmost one swap operationSeptember 26, 2017

Given a non-negative number num. The problem is to find the smallest number greater than num by performing atmost on swap operation between any two… Read More »

## Smallest number k such that the product of digits of k is equal to nSeptember 25, 2017

Given a non-negative number n. The problem is to find the smallest number k such that the product of digits of k is equal to… Read More »

## Find n-th element in a series with only 2 digits (4 and 7) allowed | Set 2 (log(n) method)September 10, 2017

Consider a series of numbers composed of only digits 4 and 7. First few numbers in the series are 4, 7, 44, 47, 74, 77,… Read More »