{"id":16325,"date":"2021-08-12T09:25:16","date_gmt":"2021-08-12T03:55:16","guid":{"rendered":"https:\/\/python-programs.com\/?p=16325"},"modified":"2021-11-22T18:38:32","modified_gmt":"2021-11-22T13:08:32","slug":"python-program-to-generate-strong-numbers-in-an-interval","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-generate-strong-numbers-in-an-interval\/","title":{"rendered":"Python Program to Generate Strong Numbers in an Interval"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Select a Random Element from a Tuple<\/a>
\nStrong number:<\/strong><\/p>\n

A Strong number is a special number in which the total of all digit factorials equals the number itself.<\/p>\n

Ex: 145 the sum of factorial of digits = 1 ! + 4 ! +5 ! = 1 + 24 +125<\/p>\n

\n

To determine whether a given number is strong or not. We take each digit from the supplied number and calculate its factorial, we will do this for each digit of the number.<\/p>\n

We do the sum of factorials once we have the factorial of all digits. If the total equals the supplied number, the given number is strong; otherwise, it is not.<\/p>\n

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

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

Example 1:<\/strong><\/p>\n

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

Given lower limit range  = 1\r\nGiven upper limit  range= 200<\/pre>\n

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

The Strong Numbers in a given range 1 and 200 are :\r\n1 2 145<\/pre>\n

Example 2:<\/strong><\/p>\n

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

Given lower limit range = 100\r\nGiven upper limit range= 60000<\/pre>\n

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

The Strong Numbers in a given range 100 and 60000 are :\r\n145 40585<\/pre>\n

Program to Generate Strong Numbers in an Interval<\/h2>\n

Below are the ways to generate Strong Numbers in a given interval.<\/p>\n