Translate the following into algebraic equation and solve: Twice the sum of a number and five is equal to 40.