Python program to find Find Sum of Series 1²+2²+3²+….+n²

number = int(input("Enter any Positive Number: "))
total = 0
# Calculation
total = (number * (number + 1) * (2 * number + 1)) / 6
# Print the Output
print("The Sum of Series upto {0}  = {1}".format(number, total))

OUTPUT:

Enter First Number of an G.P. Series: 5
Enter the Total Numbers in this G.P. Series: 6
Enter the Common Difference: 3
The Sum of Geometric Progression Series =  1820.0
The tn Term of Geometric Progression Series =  1215.0

Leave a Comment