Computer Science, asked by janegabrielle12, 4 months ago

logic for the above or algorithm​

Attachments:

Answers

Answered by anindyaadhikari13
10

Answer:-

This is the required program in python.

k=int(input("Enter the total number of terms for the series: "))

a=2,b=2,c=1,d=1,m=1,n=2

for i in range(1,k+1):

print(a, " ")

c=c+1

if(c>d):

if(d==1):

a=3

d=b

if (b==2):

b=3

m=1

elif (b==3 and m<n):

b=3

m=m+1

else:

n=n+1

b=2

else:

d=1

a=2

c=1

Program credit:- My Teacher.

Similar questions