P-finite sequences