Kiran of class 12 is writing a program to print the following series 1 1 2 3 5 8… As a programmer, help him to successfully execute the given task. [2]
a=b=1
print(a,b)
for i in range(5):
------------- //line1
------------ //line2
------------ //line3
Answers
Answer:
Social science is the branch of science devoted to the study of societies and the relationships among individuals within those societies. The term was formerly used to refer to the field of sociology, the original "science of society", established in the 19th century.
Explanation:
ɪ ʜᴏᴘᴇ ɪᴛ ɪꜱ ʜᴇʟᴘꜰᴜʟ ꜰᴏʀ ʏᴏᴜ
Explanation:
Program to print the series 1, 3, 4, 8, 15, 27, 50… till N terms
Given a number N, the task is to print the first N terms of the following series:
1, 3, 4, 8, 15, 27, 50…
Examples:
Input: N = 7
Output: 1, 3, 4, 8, 15, 27, 50
Input: N = 3
Output: 1, 3, 4
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
Approach: From the given series we can find the formula for Nth term:
1st term = 1, 2nd term = 3, 3rd term = 4
4th term = 1st term + 2nd term + 3rd term
5th term = 2nd term + 3rd term + 4th term
6th term = 3rd term + 4th term + 5th term
.
.
so on