Programming Examples

Python program to display the first ten terms of the following series 2 5 10 17


Write a Python code to display the first ten terms of the following series

2, 5, 10, 17,……………………………..

Solution:
print("The first ten terms of the series:")
for a in range(1, 11):
    p=a*a+1
    print(p, end=' ')
Output/ Explanation:

The first ten terms of the series:

2 5 10 17 26 37 50 65 82 101 

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad