Transformation formulas of finite sums into continued fractions