A generalization of a theorem of Lekkerkerker to Ostrowski's decomposition of natural numbers