Find The Sequence
Submissions: 3129   Accuracy:

21.33%

  Difficulty: Basic   Marks: 1

Adobe is weak in the concepts of string. He is given a number n and has to find n terms of that series. The series is 1, 2, 5, 8,15. . . .

Input:
You are given an integer T denoting the number of test cases. The next subsequent lines contain an integer n denoting the number of terms till which the series needs to be printed.

Output:
For each test case, print the series up to n terms.

Constraints:
1<= T <= 100
1 <= n <= 50

Example:
Input:
2

8
5

Output:
1 2 5 8 15 28 51 94
1 2 5 8 15 

Explanation:
Testcase 1:
For n=8, series comes out to be 1 2 5 8 15 28 51 94

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Siddhant Manglik
Author: adobe_3128


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.