how to use python print the series: 1 1 2 3 4 9 8 27 16.....N?N is to be taken as input.

You already invited:

sam

Upvotes from:

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

If you wanna answer this question please Login or Register