Skip to content

Latest commit

 

History

History
 
 

Peterson Number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Peterson Number

Aim

It is a program where we play with peterson numbers.

Purpose

To check whether user enterd number is peterson or not.

Short description of script

  • A number is said to be a Peterson number if the sum of factorials of each digit of the number is equal to the number itself.

  • Example: 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145

  • Here, the user enter a random number and the program will tell that the entered number is peterson or not.

Workflow of the Project

  1. Firstly, the program demands a numerical value from the user.

  2. Now, it will check the conditions passing through loops.

    • Number split into each digits.

    • Addiotion with factorial of each digits.

  3. check addtion and number both are equal or not.

  4. print the result according to above condition.

Compilation Steps

  1. Run this program in a proper IDE e.g. Pycharm, VScode ,Jupyter notebook etc or any Online compiler like Repelit.

  2. Enter the numbers.

  3. The output will show you the series.

ScreenShort

  • Code

code of Peterson Number can't displayed

  • Output

Output of Peterson Number can't displayed

Author(s)

Sumit Soni