Question: Please help me with this problem in Python! Prob. 5 Thunder-split numbers: An integer n is called a thunder-split number if it can be split
Prob. 5 Thunder-split numbers: An integer n is called a thunder-split number if it can be split into two numbers, and the square of the sum of these two numbers equals to the original number n The story behind the term thunder-split is this: An Indian mathematician travelling in a foreign land encountered a big thunder-storm, during which he saw a stone monument being struck and split in half by the thunder. Interestingly, the stone originally had 3025 on it, after the thunder-split, one part contained 30 and the other contained 25. The mathematician quickly realized that (30 25)253025, thus he named any integer having this property as a thunder-split number Besides 3025, we see that 9801 is also a thunder-split number because it can be split into 98 and 01, and (98+01)2 992 9801. Similarly, 81 is such a number since (81)2 92 81; 100 is such as nurnber since (10 + 0)2-100, and 60481729 is such a number since (6048 + 1729)2 77760481729 Write a function tsplit nums (m), where m > 10, that returns all the thunder-split numbers within the range [10, m]. Use your code to find all the thunder-split numbers in [10, 10], print all of them out using the following format (notice the empty spaces used to make the numbers align in place) 81 can be thunder-split as (8 100 can be thunder-split as (10 2025 can be thunder-split as (20 3025 can be thunder-split as (30 + 0 e.2 +25 2 +25 2 4941729 can be thunder-split as (494 + 1729 2 7441984 can be thunder-split as (744 +19842 25502500 can be thunder-split as (2550 25002 10 11 99980001 can be thunder-split as (9998 00012 Note: the above lines are part of the results for [10, 10], for this problem you only need to print out all thunder-split numbers 10,10 (because whe10 it will take very long to compute if you do not find a more efficient way) Bonus 10 points: Find a way to speed up your code so that you can compute all the thunder- split numbers in [10, 10. In this case, your results would cover all of the numbers listed above If done right, your code should take less than 2 seconds to run and finish (even on an aged laptop)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
