A population of insects grows at a tremendous rate: on January 1st 2004, there were 2004 insects. On Jan. 2nd, the number is 4009 (twice the previous amount plus 1). Each day of January, the population is multiplied by the day of month plus one.

In February, same thing but the growth is 2 instead of 1 (February: second month) so that on Feb. 2nd there are twice as many insects than on Feb. 1st, plus 2 and so on until Feb. 29th. In March, same principle but you add 3, in April add 4, etc... In December, add 12.

These insects use to fly in patrols of 13. When the number is not a multiple of 13, they manage to leave as few isolated ones as possible.

How many insects are left alone at the end of Dec. 31st 2004?

(also posted on nntp://alt.math.recreational)