{"id":12933,"date":"2021-09-30T17:00:40","date_gmt":"2021-09-30T11:30:40","guid":{"rendered":"https:\/\/python-programs.com\/?p=12933"},"modified":"2021-11-22T18:33:33","modified_gmt":"2021-11-22T13:03:33","slug":"python-program-to-check-if-a-number-is-peterson-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-check-if-a-number-is-peterson-number\/","title":{"rendered":"Python Program to Check if a Number is Peterson Number"},"content":{"rendered":"

Are you wondering how to seek help from subject matter experts and learn the Java language? Go with these Basic Java Programming Examples<\/a> and try to code all of them on your own then check with the exact code provided by expert programmers.<\/p>\n

Given a number, the task is to check whether the given number is a Peterson number or not.<\/p>\n

Peterson Number:<\/strong><\/p>\n

The Peterson number is the number whose sum of factorials of each digit equals the number itself. Let me give you an example to help you understand:<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number =1<\/pre>\n

Output:<\/strong><\/p>\n

The given number [ 1 ] is a Peterson number<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number =145<\/pre>\n

Output:<\/strong><\/p>\n

The given number [ 145 ] is a Peterson number<\/pre>\n

Program to Check if a Number is Peterson Number in Python<\/h2>\n

Below are the ways to check whether the given number is a Peterson number or not.<\/p>\n