Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''For Example, consider the given series: 1, 1, 2, 3, 4, 9, 8, 27, 16, 81, 32, 243, 64, 729, 128, 2187....
- This series is a mixture of 2 series – all the odd terms in this series form a geometric series and all the even terms form yet another geometric series.
- Write a program to find the Nth term in the series.'''
- n=int(input())
- if(n%2==0):
- n=n//2
- n=n-1
- print(3**n)
- else:
- n=n//2
- print(2**n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement