Open sujana-kamasany opened 2 years ago
Java Program to check whether a given number is Peterson or not through a Java program.
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.
Please, assign me! I'd like to solve this!
@TaeyeonRoyce Assigned, Thank you for contributing
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.