Last Updated: 30 Nov, 2016

Terms of AP

Easy
Asked in company
Sopra Steria

Problem statement

Write a program to print the first x terms of the mathematical series 3N + 2 which are not multiples of 4.

The series is defined as:

T(N) = 3N + 2, where N is a positive integer starting from 1. Your task is to print the first x terms of this series, but you should exclude any term that is a multiple of 4.

Input format :
Integer x
Output format :
Terms of series (separated by space)
Constraints :
1 <= x <= 1,000