Pratian technologies Company Programming Program

write a program to generate the following series.Accept the limit upto which the series needs to be generated.
1, -2, 6, -15, 31, -56,....N

Read Solution (Total 35)

Pratian technologies Other Question

optimize the code by applying the following logic.
The LCM for 2,3,4,5 and 6 is 60.This means that 61,121,181 etc. gives remainder 1, when divided by 2,3,4,5 and 6.You have to check whether 61,121,181 etc are now multipled. Display and mention the number of iterations needed to generate in the first case and last case.
2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131.......