Find Terms of Series Problem

Ayush is tasked with determining the first 'X' terms of the series defined by 3 * N + 2, ensuring that no term is a multiple of 4.

Input:

The first line contains a single integer 'T', the number of test cases.
Each test case includes one integer 'X', which represents the number of terms required from the series.

Output:

For each test case, return a list containing the first 'X' terms of the series 3 * N + 2 that are not multiples of 4.
Each test case's output should be on a new line.

Example:

Input:
X = 4
Output:
[5, 11, 14, 17]
Explanation:

The sequence begins as 5, 8, 11, 14, 17, ...; the numbers 5, 11, 14, and 17 are not multiples of 4.

Constraints:

  • 1 <= T <= 10^2
  • 1 <= X <= 10^5

Note: You don’t need to perform any output operations; focus on implementing the solution logic.

Anonymous
1d
ChatGPT 4o mini Log in You said: For each test case, return a vector with the first ‘X’ integer of the series 3 * ‘N’ + 2, which is not multiple of 4. Output for every test case will be printed in a s...read more
Help your peers!
Add answer anonymously...
GlobalLogic Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter