# Tag Archives: factorial

## Check if the remainder of N-1 factorial when divided by N is N-1 or not

Given an integer N where 1 ≤ N ≤ 105, the task is to find whether (N-1)! % N = N – 1 or not.… Read More »

## Print all Strong numbers less than or equal to N

Given a number N, print all the Strong Numbers less than or equal to N.   Strong number is a special number whose sum of the… 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 »

## Compositorial of a number

Given a natural number N, the task is to find the Nth compositorial number. Compositorial of a number refers to the product of all the… Read More »

## Find the last two digits of Factorial of a given Number

Given an integer N, the task is to find the last two digits of factorial of a number. Examples: Input: N = 7 Output: 40… Read More »

## Factorial of Large numbers using Logarithmic identity

Given a very large number N, the task is to find the factorial of the number using Log. Factorial of a non-negative integer is the… Read More »

## Total number Of valid Home delivery arrangements

Given number of orders, find the number of valid arrangements of orders where delivery of ith order is always after the pickup of ith order.Examples:… Read More »

## Find last digit in factorial

Given a number n, we need to find the last digit in factorial n. Input : n = 4Output : 44! = 4 * 3… Read More »

## Sum of factorials of Prime numbers in a Linked list

Given a Linked list of N integers, the task is to find the sum of factorials of each prime element in the list. Examples: Input:… Read More »

## Golang Program to Count Trailing Zeros in Factorial of a Number

Given an integer n, write a Go program to count the number of trailing zeros in the factorial of n. Examples: Input : 7 Output… Read More »

## Find the next Factorial greater than N

Given a number N (≤ 1018), the task is to find the next factorial number greater than N. Examples: Input: N = 24 Output: 120… Read More »

## Check if N-factorial is divisible by X^Y

Given three integers N, X and Y, the task is to check that if N! is divisible by XY Examples: Input: N = 10, X… Read More »

## Find the length of factorial of a number in any given base

Given an integer n and base B, the task is to find the length of n! in base B. Examples: Input: n = 4, b… Read More »

## Finding powers of any number P in N!

Prerequisite: Print all prime factors and their powers Given natural numbers N and P, the task is to find the power of P in the… Read More »

## Minimum number of Factorials whose sum is equal to N

Given a number N (<1010), the task is to find the minimum number of factorials needed to represent N, as their sum. Also, print those… Read More »