Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

number if it call p ob. 5 Thunder-split numbers: An integer n is called a thunder-split The story behind the term thunder-split is this: An

image text in transcribed
number if it call p ob. 5 Thunder-split numbers: An integer n is called a thunder-split The story behind the term thunder-split is this: An Indian mathematician travelling in a foreign and 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 hunder-split, one part contained 30 and the other contained 25. The mathematician qickly realized that thunder-split number. mumbers, and the square of the sum of these two numbers equals to the original number n. (30+25) -55 3025, thus he named any integer having this property as a Besides 3025, we see that 9801 is also a thunder-split number because it can be split into 3o 01, and (98 + 01)2-992-8801. Similarly, 81 is such a number since (8+1)2-92-81; 100 is such as number since (10+0)2 100, and 60481729 is such a number since (6048+1729) 77772 60481729. 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 numbe 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 e+2 + 25 4941729 can be thunder-split as (494 + 1729)2 7441984 can be thunder-split as (744 + 1984 2 9 25502500 can be thunder-split as (2550 + 2 10 99980001 can be thunder-split as (9998 Note: the above lines are part of the results for [10, 109], for this problem you only need to print out all thunder-split numbers in [10,107] (because when m = 109 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, 109]. 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 agecd laptop)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

2. What are your challenges in the creative process?

Answered: 1 week ago