The program is to find a mathematical series, where we need to accept the value of n and m. n is the base number and m is the number of times till which the series run.
Input : 2 + 22 + 222 + 2222 + 22222 Output : 24690 Input : 12 + 1212 + 121212 Output : 122436
We first covert the numbers into string format and concatenate them regularly. Later, we convert them back to integer and add them upto mth term. as shown in the following program.
- Python program to calculate age in year
- Python | Repeat each element K times in list
- Python | Add similar value multiple times in list
- Python | Calculate difference between adjacent elements in given list
- Python | Check if k occurs atleast n times in a list
- Python | Remove elements of list that are repeated less than k times
- Python | Calculate geographic coordinates of places using google geocoding API
- Python | Calculate distance and duration between two places using google distance matrix API
- Python | Pandas Series.mad() to calculate Mean Absolute Deviation of a Series
- Python | Find the Number Occurring Odd Number of Times using Lambda expression and reduce function
- Program to calculate the Round Trip Time (RTT)
- Program to Calculate Body Mass Index (BMI)
- Important differences between Python 2.x and Python 3.x with examples
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.