How to display the given series in Python? 1 1 2 2 2 4 3 3 6 4 4 8....N terms.
Logic:
First two terms - 1 and 1, sum = 1 + 1 = 2. Third term = 2.
Next two terms - 2 and 2, sum = 2 + 2 = 4, sixth term = 4 etc.
Note: Don't use more than 1 print statement inside loop.
Share
0 Replies