Determine the remainder in the division of $ a_ {2019} $

62 Views Asked by At

Consider the sequence set by $ a_1 = 0 $, $ a_2 = 1 $, and for $ n \geq 3 $ $$ a_n = (n-1) (a_ {n-1} + a_ {n-2}) $$Determine the remainder in the division of $ a_ {2019} $ by 2019

a) 1

b)2

c) 2017

d)2018

$a_n-na_{n-1}=- (a_{n-1}-(n-1)a_{n-2})=(a_{n-2}-(n-2)a_{n-3})=...=(-1)^{n-1} (a_1-a_0)=(-1)^{n-1}$

So $a_{2019}=2019a_{2018}+(-1)^{2018} \to a_{2019} \equiv 1 \pmod {2019}$

Correct?