Problem

Source: Central American Olympiad 2001, problem 4

Tags:



Determine the smallest positive integer $ n$ such that there exists positive integers $ a_1,a_2,\cdots,a_n$, that smaller than or equal to $ 15$ and are not necessarily distinct, such that the last four digits of the sum, \[ a_1!+a_2!+\cdots+a_n!\] Is $ 2001$.