## Smallest number with at least n digits in factorial

Given a number n. The task is to find the smallest number whose factorial contains at least n digits. Examples: Input : n = 1… Read More »

- Range and Update Sum Queries with Factorial
- Number of ways to go from one point to another in a grid
- Program to calculate the value of nPr
- Number of trailing zeroes in base 16 representation of N!
- Find GCD of factorial of elements of given array
- Number of trailing zeroes in base B representation of N!
- Check if factorial of N is divisible by the sum of squares of first N natural numbers
- Check whether factorial of N is divisible by sum of first N natural numbers
- Number of ways to arrange K different objects taking N objects at a time
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Maximum number with same digit factorial product
- Find the smallest number X such that X! contains at least Y trailing zeros.
- Check if a given number divides the sum of the factorials of its digits
- Count numbers having N 0's and and M 1's with no leading zeros
- Find sum of factorials in an array
- Count different numbers possible using all the digits their frequency times
- Check if N is a Factorial Prime

Given a number n. The task is to find the smallest number whose factorial contains at least n digits. Examples: Input : n = 1… Read More »

Given a number n, find the last non-zero digit in n!. Examples: Input : n = 5 Output : 2 5! = 5 * 4… Read More »

Given a number n. The task is to find the smallest number whose factorial contains at least n trailing zeroes. Examples : Input : n… Read More »

Given two numbers x and y (x <= y), find out the total number of natural numbers, say i, for which i! is divisible by… Read More »

Given a number x, the task is to find first natural number i whose factorial is divisible by x. Examples : Input : x =… Read More »

Given a number n, the task is to calculate its primorial. Primorial (denoted as Pn#) is product of first n prime numbers. Primorial of a… Read More »

Given a number n, count total number of divisors of n!. Examples: Input : n = 4 Output: 24 4! is 24. Divisors of 24… Read More »

Given an integer n (can be very large), find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) =… Read More »

Given an integer n, find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) = 1*2*3*4……..*n and factorial(0) =… Read More »

Given a positive integer n, find the no of factors in n! where n <= 105. Examples : Input : n = 3 Output :… Read More »

Given a large number n and a prime p, how to efficiently compute n! % p? Examples : Input: n = 5, p = 13… Read More »

A number F is a factorial number if there exists some integer I >= 0 such that F = I! (that is, F is factorial… Read More »

Given an integer n and a prime number p, find the largest x such that px (p raised to power x) divides n! (factorial) Examples:… Read More »

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

Given a positive integer n, write a function to compute sum of the series 1/1! + 1/2! + .. + 1/n! A Simple Solution solution… Read More »