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

The first ten terms of the series:

2 5 10 17 26 37 50 65 82 101 

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad