## Program to find the sum of a Series 1/1! + 2/2! + 3/3! + 4/4! +…….+ n/n!

You have been given a series 1/1! + 2/2! + 3/3! + 4/4! +…….+ n/n!, find out the sum of the series till nth term.… Read More »

## An interesting solution to get all prime numbers smaller than n

This approach is based on Wilson’s theorem and using the fact that factorial computation can be done easily using DP Wilson theorem says if a… Read More »

## Finding power of prime number p in n!

Given a number ‘n’ and a prime number ‘p’. We need to find out the power of ‘p’ in the prime factorization of n! Examples:… Read More »

## Calculating Factorials using Stirling Approximation

We are aware of calculating factorials using loops or recursion, but if we are asked to calculate factorial without using any loop or recursion. Yes,… Read More »

## Check if a number is a Krishnamurthy Number or not

A Krishnamurthy number is a number whose sum of the factorial of digits is equal to the number itself. For example 145, sum of factorial… Read More »

## Find a range of composite numbers of given length

Given an integer n, we need to find a range of positive integers such that all the number in that range are composite and length… Read More »

## Smallest number S such that N is a factor of S factorial or S!

Given a number N. You are tasked with finding the smallest number S, such that N is a factor of S! (S factorial). N can… Read More »

## Find sum of digits in factorial of a number

Given a number n, write code to find the sum of digits in the factorial of the number. Given n <= 5000 Examples: Input :… Read More »

## Sum of divisors of factorial of a number

Given a number n, we need to calculate the sum of divisors of factorial of the number. Examples: Input : 4 Output : 60 Factorial… Read More »

## Maximum value of an integer for which factorial can be calculated on a machine

Program to find maximum value of an integer for which factorial can be calculated on a machine, assuming that factorial is stored using basic data… Read More »

## Program to check Strong Number

Strong Numbers are the numbers whose sum of factorial of digits is equal to the original number. Given a number, check if it is a… Read More »

## Compute nCr % p | Set 3 (Using Fermat Little Theorem)

Given three numbers n, r and p, compute value of nCr mod p. Here p is a prime number greater than n. Here nCr is… Read More »

## k-th prime factor of a given number

Given two numbers n and k, print k-th prime factor among all prime factors of n. For example, if the input number is 15 and… Read More »

## Double factorial

Double factorial of a non-negative integer n, is the product of all the integers from 1 to n that have the same parity (odd or… Read More »

## 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 »