Linear recurrence sequences and periodicity of multidimensional continued fractions