Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program that reads a number and finds the sum of the series of 1 + 33 + 111 + 3333 +....+N terms.

Write a Python program that reads a number and finds the sum of the series of 1 + 33 + 111 + 3333 +....+N terms. Then it puts the reverse digit of the sum to a list and prints it. [Cannot use built-in reverse() or reversed()]

================================================

Sample Input 1: 5 Sample Output 1: Sum of series: 14589 Reverse sum of series in list: [9, 8, 5, 4, 1] Explanation1: The input is 5 so the series will go on till 5th term. So the series becomes, 1 + 33 + 111 + 3333 + 11111. So the sum of the series is 14589. The reverse of the sum is 98541. So the reverse digits are 9, 8, 5, 4 and 1. Thus putting them into a list, the output becomes [9, 8, 5, 4, 1]

================================================

Sample Input 2: 3 Sample Output 2: Sum of series: 145 Reverse sum of series in list: [5, 4, 1] Explanation2: The input is 3 so the series will go on till 3th term. So the series becomes, 1 + 33 + 111. So the sum of the series is 145. The reverse of the sum is 541. So the reverse digits are 5, 4 and 1. Thus putting them into a list, the output becomes [ 5, 4, 1]

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions