(Solved) : P 2 Pythagorean Triplet Set Three Natural Numbers Acbc Example 34 S Anda B 345 12 Exis Q41406861 . . .

P#2. A Pythagorean triplet is a set of three natural numbers, acbc, for which . . . For example, 3.4 S. Anda+b+ .3.4.5. 12.

5 5.8.4.2.1 6 6,3,5,8,4,2,1 7 7 .11, 17, 26, 13, 20, 10,5,8, 4,2,1 26 If you decide not to stop, after the sequence reaches 1

Pleasee I need the best answerrs for this questions!!In Language PYTHONNNN! PLEASE HELP ME!

P#2. A Pythagorean triplet is a set of three natural numbers, acbc, for which . . . For example, 3.4 S’. Anda+b+ .3.4.5. 12. There exists exactly two Pythagorean triplet for which a+b+c-300. Find a, b, c. Hints: Level-0 Algorithm: 1. Find the possible ranges of a and b for which a+b+c is around 300 (include the paper & pencil analysis at the end of your report) 2. Compute for each combination of a and b 3. Verify if a + b + c = 300 and a + b = 2 and a <b<c 4. Print results P#3. Sequence. Suppose we select some initial number T, and then build the sequence of values by the following rules: TE – for values of Ts- even Ti (3T — + 1) for values of T odd As long as you reach 1 the sequence must stop. If Tiis odd. the next element in the sequence grows, and if it is even, the next element in the sequence decreases. With different starting values, examples of the generated sequences are: Starting value To T.T.T.T3- Maximum value in the secuence 2 2.1 3,5,8, 4, 2,1 4.2,1 4 Page 5 5 5 ,8, 4, 2,1 6,3,5,8, 4, 2,1 6 7 7 .11, 17, 26, 13, 20. 10.5, 8, 4,2,1 26 If you decide not to stop, after the sequence reaches the sequence enters the Infinite loop as 121212. You need to avoid this effect in your code. You don’t want an infinite loop. Write code to 1. Compute the elements of the sequence for starting values from 1 to 25. Make a plot of the starting value versus the number of elements in the sequence to get 1 Es, if the starting T = 7, the number of elements in the sequence are 12, these are: 7.11.17, 26, 13, 20. 10.5.8.4.2,1 An example of the plot 5 5.8.4.2.1 6 6,3,5,8,4,2,1 7 7 .11, 17, 26, 13, 20, 10,5,8, 4,2,1 26 If you decide not to stop, after the sequence reaches 1 the sequence enters the Infinite loop as 121212. You need to avoid this effect in your code. You don’t want an infinite loop. Write code to 1. Compute the elements of the sequence for starting values from 1 to 25. Make a plot of the starting value versus the number of elements in the sequence to get 1. Eg, if the starting T 7, the number of elements in the sequence are 12, these are: 7, 11, 17, 26, 13, 20, 10, 5, 8, 4, 2, 1. An example of the plot 2. Calculate what is the maximum value reached in the sequence for each starting value Show transcribed image text P#2. A Pythagorean triplet is a set of three natural numbers, acbc, for which . . . For example, 3.4 S’. Anda+b+ .3.4.5. 12. There exists exactly two Pythagorean triplet for which a+b+c-300. Find a, b, c. Hints: Level-0 Algorithm: 1. Find the possible ranges of a and b for which a+b+c is around 300 (include the paper & pencil analysis at the end of your report) 2. Compute for each combination of a and b 3. Verify if a + b + c = 300 and a + b = 2 and a

Expert Answer


Answer to Pleasee I need the best answerrs for this questions!! In Language PYTHONNNN! PLEASE HELP ME!…