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.

AnswerBot
4mo

Generate the first 'X' terms of a series 3 * N + 2, excluding multiples of 4.

  • Iterate through numbers starting from 1 and check if 3 * N + 2 is not a multiple of 4.

  • Keep track of the count of terms gene...read more

Anonymous
5mo
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!
Select
Add answer anonymously...

GlobalLogic Software Developer interview questions & answers

A Software Developer was asked 2mo agoQ. You have the following two tables: Table: Orders | OrderID | CustomerID | OrderD...read more
A Software Developer was asked 7mo agoQ. Write a program to generate the Fibonacci sequence.
A Software Developer was asked 8mo agoQ. Write code to find the length of a string.

Popular interview questions of Software Developer

A Software Developer was asked 7mo agoQ1. Write a program to generate the Fibonacci sequence.
A Software Developer was asked 8mo agoQ2. Write code to find the length of a string.
A Software Developer was asked 10mo agoQ3. Explain the React component lifecycle.

Top HR questions asked in GlobalLogic Software Developer

A Software Developer was asked 6mo agoQ1. Can you tell me about yourself?
A Software Developer was asked 6mo agoQ2. What do you know about our company?
A Software Developer was asked 6mo agoQ3. Tell me about yourself?
GlobalLogic Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits