Question: Write a function to compute the nth number of the following series: Given a value x , multiply all the non-zero digits of x together

Write a function to compute the nth number of the following series: Given a value x , multiply all the non-zero digits of x together and then add that value to x to get the next number in the series. The function should be named: some_series.

1, 2, 4, 8, 16, 22, 26, 38, 62, 74, 102, 104, 108, 116, 122, 126, 138, 162, 174, 202, 206, 218, 234, 258, 338, 410, 414, 430, 442, 474, 586, 826, 922, 958, 1318, 1342, 1366, …

Write a main program that prompts the user to enter ā€œnā€ and prints out the nth number of the series.

Step by Step Solution

3.45 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem well create a function named someseries that generates numbers in the given se... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!