Vintage Capital in the AK growth model: a dynamic programming approach: extended version