Part of the series

Several example codes

~1 min read • Updated Oct 12, 2025

Program Overview

This Python program reads a number n from the user and calculates the sum of the first 11 terms of a numeric series.
In this version, we assume the series is simply the sum of integers from n to n+10, but you can replace the formula with any custom logic.


Python Code:


def series_sum(start: int, count: int = 11) -> int:
    total = 0
    for i in range(start, start + count):
        total += i  # Replace this line with any custom series formula
    return total

# Read input from user
n = int(input("Enter the starting number of the series: "))
result = series_sum(n)
print(f"The sum of the first 11 terms starting from {n} is: {result}")

Sample Output (input: n = 11):


The sum of the first 11 terms starting from 11 is: 176

Written & researched by Dr. Shahin Siami