SHARE
TWEET

Untitled

a guest Jul 16th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '''For Example, consider the given series: 1, 1, 2, 3, 4, 9, 8, 27, 16, 81, 32, 243, 64, 729, 128, 2187....
  2. 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.
  3. Write a program to find the Nth term in the series.'''
  4. n=int(input())
  5. if(n%2==0):
  6.     n=n//2
  7.     n=n-1
  8.     print(3**n)
  9. else:
  10.     n=n//2
  11.     print(2**n)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top