P-Recursive Integer Sequences And Automata Theory