main = do
  n <- readLn :: IO Int
  k <- readLn :: IO Int

  print $ minimum (func n k)

  where
    func 0 _ = [1]
    func n k = concat [map (*2) res, map (+k) res]
      where
        res = func (n-1) k
