Most Wondrous

This is a challenge exercise. It is not compulsory, and may be completed individually or with your lab partner.

Below is the length of the wondrous sequence I get when starting with certain numbers. For example, the sequence starting with 97 has length 119.

Write a C program to find the smallest starting value which has length over 1234.

tip: be careful of your numbers getting too big and overflowing. You might want to investigate unsigned long long numbers, and/or think of your own way of representing big numbers using two or more smaller numbers somehow.

Don’t use any c libraries except those we have already covered in class.

Save your answer in a text file called mostwondrous.txt, and submit that when you have found the answer.

To run Styl-o-matic:

$ 1511 stylomatic mostwondrous.txt
Looks good!

You’ll get advice if you need to make changes to your code.

Submit your work with the give command, like so:

$ give cs1511 wk07_mostWondrous

Or, if you are working from home, upload the relevant file(s) to the wk07_mostWondrous activity on Give Online.