Question: 1) Write a code (with the filename Q1.py) that will find and count 4-digit (from 1,000 to 10,000) Disarium numbers. (30p) Hint: A number will

 1) Write a code (with the filename "Q1.py") that will find

1) Write a code (with the filename "Q1.py") that will find and count 4-digit (from 1,000 to 10,000) Disarium numbers. (30p) Hint: A number will be called DISARIUM if sum of its digits powered with their respective position is equal to the original number. abc which is a 3-digit number would be Disarium if abc = al + b2 + c3 abcd which is a 4-digit number would be Disarium if abcd = a1 + b + c3 + d4 For example 135 is a DISARIUM number because 11 + 32 + 53 135 For example 1306 is a DISARIUM number because 11 + 32 + 03 + 64 1306 = Hint-2: The number of 4-digit Disarium numbers is 3. Hint-3: 1306 is the smallest 4-digit Disarium number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!