maths.special_numbers.krishnamurthy_number

== Krishnamurthy Number ==

It is also known as Peterson Number A Krishnamurthy Number is a number whose sum of the factorial of the digits equals to the original number itself.

For example: 145 = 1! + 4! + 5!

So, 145 is a Krishnamurthy Number

Attributes

number

Functions

factorial(→ int)

krishnamurthy(→ bool)

Module Contents

maths.special_numbers.krishnamurthy_number.factorial(digit: int) int
>>> factorial(3)
6
>>> factorial(0)
1
>>> factorial(5)
120
maths.special_numbers.krishnamurthy_number.krishnamurthy(number: int) bool
>>> krishnamurthy(145)
True
>>> krishnamurthy(240)
False
>>> krishnamurthy(1)
True
maths.special_numbers.krishnamurthy_number.number