Python Program to print 1,4,7,10,13… series up to N

print("Enter Last Number : ")
a = int(input())
for i in range(0,a+1, 1):
 	if(i%3==1):
 		print(i,",",end="")

Output :
Enter Last Number : 25
1,4,7,10,13,16,19,22,25,



Leave a comment