Generating numbers that are divisor of their right-rotations

Given a number m, find all numbers which have m digits and are a divisor of their right-rotation. Right-rotation of a number N is the… Read More »

Program to find the N-th term of series 3, 5, 33, 35, 53…. | Set-2

Given a series of numbers composed only of digits 3 and 5. The first few numbers in the series are: 3, 5, 33, 35, 53,… Read More »

Divide a number into two parts such that sum of digits is maximum

Given a number N. The task is to find the maximum possible value of SumOfDigits(A) + SumOfDigits(B) such that A + B = n (0<=A,… Read More »

Count numbers (smaller than or equal to N) with given digit sum

Given a number N and a sum S, find the count of numbers upto N that have digit sum equal to S. Examples: Input :… Read More »

Sum of Digits in a^n till a single digit

Given two numbers a and n, the task is to find the single sum of digits of a^n (pow(a, n)). In single digit sum, we… Read More »

Maximum of sum and product of digits until number is reduced to a single digit

Given a number N, the task is to print the maximum between the sum and multiplication of the digits of the given number until the… Read More »

Program for replacing one digit with other

Given a number x and two digits d1 and d2, replace d1 with d2 in x. Examples: Input : x = 645, d1 = 6,… Read More »

Check if a number is divisible by 41 or not

Given a number, the task is to quickly check if the number is divisible by 41 or not. Examples: Input : x = 123 Output… Read More »

Numbers with sum of digits equal to the sum of digits of its all prime factor

Given a range, the task is to find the count of the numbers in the given range such that the sum of its digit is… Read More »

Check if the first and last digit of the smallest number forms a prime

Given an array arr[] containing numbers from 0 to 9 only, the task is to form the minimum possible number from the given digits and… Read More »

Modulo power for large numbers represented as strings

Given two numbers sa and sb represented as strings, find ab % MOD where MOD is 1e9 + 7. The numbers a and b can… Read More »

Find next palindrome prime

Find the smallest palindrome number which is prime too and greater then given number N. Examples: Input : N = 7 Output :11 11 is… Read More »

Sudo Placement[1.7] | Greatest Digital Root

Given a number N, you need to find a divisor of N such that the Digital Root of that divisor is the greatest among all… Read More »

Find the slope of the given number

Find the slope of the given number num. Slope of a number is the count of the minima and maxima digits in it. A digit… Read More »

Recursive program to check if number is palindrome or not

Given a number, the task is to write a recursive function which checks if the given number is palindrome or not. Examples: Input : 121… Read More »