## Sum of square of first n even numbers

Given a number n, find sum of square of first n even natural numbers. Examples : Input : 3 Output : 56 22 + 42… Read More »

## Smallest number with sum of digits as N and divisible by 10^N

Find the smallest number such that the sum of its digits is N and it is divisible by . Examples : Input : N =… Read More »

## Difference between sum of the squares of first n natural numbers and square of sum

Given an integer n, find the absolute difference between sum of the squares of first n natural numbers and square of sum of first n… Read More »

## Octagonal number

You are given a number n, the task is to find nth octagonal number. Also, find the Octagonal series till n. An octagonal number is… Read More »

## Check whether the two numbers differ at one bit position only

Given two non-negative integers a and b. The problem is to check whether the two numbers differ at one bit position only or not. Examples:… Read More »

## Smallest n digit number divisible by given three numbers

Given x, y, z and n, find smallest n digit number which is divisible by x, y and z. Examples: Input : x = 2,… 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 »

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

## N expressed as sum of 4 prime numbers

Express a given number as a summation of 4 positive primes. If it is not possible to express then print “-1”. Examples: Input: 24 Output:… Read More »

## Check whether a number has exactly three distinct factors or not

Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has… Read More »

## Series with largest GCD and sum equals to n

Given an integer n, print m increasing numbers such that the sum of m numbers is equal to n and the GCD of m numbers… Read More »

## Number of compositions of a natural number

Given a natural number n, find the number of ways in which n can be expressed as a sum of natural numbers when order is… Read More »

## Next higher palindromic number using the same set of digits

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 »

## Product of factors of number

Given a number n, find the product of all factors of n. Since the product can be very large answer it modulo 10^9 + 7.… Read More »

## Smallest K digit number divisible by X

Integers X and K are given. The task is to find smallest K-digit number divisible by X. Examples : Input : X = 83, K… Read More »