Adjusting stock prices for dividends and splits is a common problem.
The following links illustrate methodologies used by various data providers.
How does Yahoo finance adjust stock data for splits and dividends?
This answer has been updated to reflect changes to Yahoo's historical prices. It is accurate as of 2017/12/15.] Yahoo…