Algebraic p-adic expansions