An algorithm for solving the fractional vibration equation