Rational power series, sequential codes and periodicity of sequences