[Solved]Don T Worry Happy Happy Number Defined Following Process Starting Positive Integer Replace Q37239861
Using Dr Racket R5RS

Don’t worry be happy A happy number is defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits in base-ten, and repeat the process until the number either equals 1 (where it will stay), or it loops endlessly in a cycle that does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers (or sad numbers). For example, 19 is happy, as the associated sequence is 12 + 92-82, 8222-68, 62 82100, 12 02 02 -1 If the cycle gets into this loop, then the number is not happy! 4 -1637-58-89 – 145-42-20 -4 – It’s safe to sayIf the cycle hits the value 4 at any time then it’s an Sad Number. Is 91 happy? 92 + 12 82 822220 22 02-4 » Sad Create a function happy? that takes one parameter and returns #t or #f if the number is happy! (Yes, you can/should use certain code made earlier in this assignment) 55562 ) #f (happy? Hints: write a function to take apart a number into a Tist of digits .(quotient gives the result of integer division (modulois how we do modulus (% operator) in scheme You might use a higher-order function such as apply or map to help out Show transcribed image text Don’t worry be happy A happy number is defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits in base-ten, and repeat the process until the number either equals 1 (where it will stay), or it loops endlessly in a cycle that does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers (or sad numbers). For example, 19 is happy, as the associated sequence is 12 + 92-82, 8222-68, 62 82100, 12 02 02 -1 If the cycle gets into this loop, then the number is not happy! 4 -1637-58-89 – 145-42-20 -4 – It’s safe to sayIf the cycle hits the value 4 at any time then it’s an Sad Number. Is 91 happy? 92 + 12 82 822220 22 02-4 » Sad Create a function happy? that takes one parameter and returns #t or #f if the number is happy! (Yes, you can/should use certain code made earlier in this assignment) 55562 ) #f (happy? Hints: write a function to take apart a number into a Tist of digits .(quotient gives the result of integer division (modulois how we do modulus (% operator) in scheme You might use a higher-order function such as apply or map to help out
Expert Answer
Answer to Don’t worry be happy A happy number is defined by the following process: Starting with any positive integer, replace the… . . .
OR

