# Tag Archives: Numbers

## Sum of all even numbers in range L and R

Given two integers L and R, the task is to find the sum of all even numbers in range L and R. Examples: Input: L… Read More »

## Common prime factors of two numbers

Given two integer and , the task is to find the common prime divisors of these numbers. Examples: Input: A = 6, B = 12… Read More »

## Count pairs of numbers from 1 to N with Product divisible by their Sum

Given a number . The task is to count pairs (x, y) such that x*y is divisible by (x+y) and the condition 1 <= x… Read More »

## Find minimum operations needed to make an Array beautiful

Given a binary array( consider it as cyclic with start and end tied together) of length N having only one’s and zero’s where . The… Read More »

## Minimum number of cuts required to make circle segments equal sized

Given an array of elements where each element in the array represents the degree ( 0 <= a[i] <= 359 ) at which there is… Read More »

## Find permutation of n which is divisible by 3 but not divisible by 6

Given an integer . The task is to find another interger which is permutation of n, divisible by 3 but not divisible by 6. Given… Read More »

## Next greater Number than N with the same quantity of digits A and B

Given a number and two digits and . The task is to find the least number not less than N which contains the equal number… Read More »

## Count the number of carry operations required to add two numbers

Given two numbers, the task is to find the number of carry operations required when two numbers are added as below. 1234 + 5678 ——–… Read More »

## Program to find the Nth Harmonic Number

Given a number N. The task is to find the Nth Harmonic Number. Let the nth harmonic number be Hn. The harmonic series is as… Read More »

## Check whether a given Number is Power-Isolated or not

Given a integer N, with prime factorisation n1p1 * n2p2 …… The task is to check if the integer N is power-isolated or not. An… Read More »

## C program to Check Whether a Number is Positive or Negative or Zero

Given a number A. The task is to check whether A is positive, negative or zero. Examples: Input: A = 2 Output: 2 is positive… Read More »

## Triplet with no element divisible by 3 and sum N

Given an integer N greater than 2, the task is to print any combination of a, b and c such that: a + b +… Read More »

## Fascinating Number

Given a number N, the task is to check whether it is fascinating or not. Fascinating Number: When a number( 3 digits or more )… Read More »

## 10’s Complement of a decimal number

Given a decimal number N. The task is to find 10’s complement of the number N. Example: Input : 25 Output : 10’s complement is… Read More »

## Tetranacci Numbers

The tetranacci numbers are a generalization of the Fibonacci numbers defined by the recurrence relation T(n) = T(n-1) + T(n-2) + T(n-3) + T(n-4) with… Read More »