# Tag Archives: maths-power

## Check if a large number is divisible by a number which is a power of 2

Given a large number in the form of a string str and a number K, the task is to check if the number formed by… Read More »

## Sum of first N natural numbers with all powers of 2 added twice

Given an integer N, the task is to calculate the sum of first N natural numbers adding all powers of 2 twice to the sum.… Read More »

## Smallest number whose square has N digits

Given a number N, the task is to find the smallest number whose square has N digits. Examples: Input: N = 2 Output: 4 Explanation:… Read More »

## Count of elements which cannot form any pair whose sum is power of 2

Given an array arr[] of length N, the task is to print the number of array elements which cannot form a pair with any other… Read More »

## Count of pairs whose bitwise AND is a power of 2

Given an array arr[] of N positive integers. The task is to find the number of pairs whose Bitwise AND value is a power of… Read More »

## Find number of pairs (x, y) in an Array such that x^y > y^x | Set 2

Given two arrays X[] and Y[] of positive integers, find the number of pairs such that x^y > y^x where x is an element from… Read More »

## Find elements in a given range having at least one odd divisor

Given two integers N and M, the task is to print all elements in the range [N, M] having at least one odd divisor. Examples:… Read More »

## James Joyce’s “Ulysses” sequence

James Joyce’s “Ulysses” sequence represents the number of digits in NNN. First few terms in James Joyce’s “Ulysses” sequence are 1, 2, 13, 155, 2185,… Read More »

## Find all powers of 2 less than or equal to a given number

Given a positive number N, the task is to find out all the perfect powers of two which are less than or equal to the… Read More »

## Sum of absolute difference of all pairs raised to power K

Given an array arr[] of N integers and a number K, the task is to find the sum of absolute difference of all pairs raised… Read More »

## Powers of 2 to required sum using Bit Masking

Given an integer N, the task is to find the numbers which when added after being raised to the Power of 2 gives the integer… Read More »

## Last two digits of powers of 7

Given a positive N, the task is to find the last two digits of 7N. Examples: Input: N = 5 Output: 07 Explanation: The value… Read More »

## Last digit of a number raised to last digit of N factorial

Given two number X and N, the task is to find the last digit of X raised to last digit of N factorial, i.e. .… Read More »

## Probability that an arbitrary positive divisor of 10^X is an integral multiple of 10^Y

Given two numbers X and Y, the task is to find the probability that an arbitrary positive divisor of 10X is an integral multiple of… Read More »

## Count numbers from range whose prime factors are only 2 and 3 using Arrays | Set 2

Given two positive integers L and R, the task is to count the elements from the range [L, R] whose prime factors are only 2… Read More »