Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import math
  2. def P5 (b):
  3.     temp=0
  4.     if b<5:
  5.         return b
  6.     elif b==5:
  7.         return 3*2
  8.     elif b%3==0:
  9.         temp=int(b/3)
  10.         #print ("multiple of three:"+str(temp))
  11.         return (3)**temp
  12.     else:
  13.         #print ("Value:"+str(math.floor(b/3)))
  14.         return P5((int(math.floor(b/2))))*P5(((int(math.floor(b/2))+1)))
  15.  
  16. for i in range (1,50):
  17.     dummy=P5(i)
  18.     print (dummy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement