This seems to be a collection of two series. 1 2 4 8 16 , and 1 3 9 27 _ , one is power series of 2 and another is 3. Firstly you should check whether the given input N can occur in the series. If yes, just go ahead and do the loop
Ah, some markdown stuff happened in my reply.. basically at odd positions the series of 1 2 4 8 16 is there and in between them at even positions is the series of 1 3 9 27 ... assuming 1-based indexing
1 Answers
sam
Upvotes from:
Ah, some markdown stuff happened in my reply.. basically at odd positions the series of 1 2 4 8 16 is there and in between them at even positions is the series of 1 3 9 27 ... assuming 1-based indexing