Problem

Source:

Tags: Comc



For any positive integer number $k$, the factorial $k!$ is defined as a product of all integers between $1$ and $k$ inclusive: $k!=k\times{(k-1)}\times\dots\times{1}$. Let $s(n)$ denote the sum of the first $n$ factorials, i.e. $$s(n)=\underbrace{n\times{(n-1)}\times\dots\times{1}}_{n!}+\underbrace{(n-1)\times{(n-2)}\times\dots\times{1}}_{(n-1)!}+\cdots +\underbrace{2\times{1}}_{2!}+\underbrace{1}_{1!}$$Find the remainder when $s(2024)$ is divided by $8$