''' Purpose : solve geom.py test problem ''' # get input reply = input( 'Enter two integers: ' ) # convert input into integers x and n w1, w2 = reply.split() x = int( w1 ) n = int( w2 ) # calculate result - follow the given formula result = 1 + ( 1 - x ** n ) // ( 1 - x ) # print result print( result )