Peterson Number in Java #65
Labels
good first issue
Good for newcomers
Hacktoberfest-Accepted
Make your Pull Request for Hacktoberfest 2023
Java
Basic Java Programs
Java Program to check whether a given number is Peterson or not through a Java program.
Peterson Number
A number is said to be Peterson if the sum of factorials of each digit is equal to the sum of the number itself.
Number = 145
145 = !1 + !4 + !5
=1+4321+5432*1
=1+24+120
145=145
We observe that the number and the sum of factorials of digits are equal to the number itself. Hence, 145 is a Peterson number.
The text was updated successfully, but these errors were encountered: