## Count Divisors of Factorial

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 »

## Count digits in a factorial | Set 2

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 »

## Count digits in a factorial | Set 1

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 »

## No of Factors of n!

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

## Compute n! under modulo p

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

## Count factorial numbers in a given range

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 »

## Legendre’s formula (Given p and n, find the largest x such that p^x divides n!)

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 large number

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 »

## Efficient Program to Compute Sum of Series 1/1! + 1/2! + 1/3! + 1/4! + .. + 1/n!

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 »

## C program to calculate the value of nPr

nPr represents n permutation r and value of nPr is (n!) / (n-r)!. filter_none edit close play_arrow link brightness_4 code #include<stdio.h>    int fact(int n)… Read More »

## Java Program for factorial of a number

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 »

## C Program for factorial of a number

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 »

## Python Program for factorial of a number

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 »

## Program for factorial of a number

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 »

## Count trailing zeroes in factorial of a number

Given an integer n, write a function that returns count of trailing zeroes in n!. Examples : Input: n = 5 Output: 1 Factorial of… Read More »