第 676 题:(2017 AIME II, 8)
Find the number of positive integers $n$ less than $2017$ such that \[1+n+\frac{n^2}{2!}+\frac{n^3}{3!}+\frac{n^4}{4!}+\frac{n^5}{5!}+\frac{n^6}{6!}\] is an integer.
- Multiplying by $720$, we need $720=2^4\cdot3^2\cdot5\mid n^6+6n^5+30n^4+120n^3+360n^2+720n+720$.
- Mod $5$, $n^6+n^5=n^5(n+1)\equiv0$, so $n\equiv0,4\pmod5$. Mod $3$, $n^6\equiv0$, so $3\mid n$, and then every term except $720$ has a factor $9$ (e.g.\ $30n^4$, $120n^3$). Mod $2$, $n$ is even, and then each term is divisible by $16$.
- So $n\equiv0\pmod 6$ and $n\equiv0,4\pmod5$, i.e.\ $n\equiv0$ or $24\pmod{30}$. Below $2017$ there are $67$ of each.
- Total $134$. The answer is $\boxed{134}$.
Find the number of positive integers $n$ less than $1500$ such that \[1+n+\frac{n^2}{2!}+\frac{n^3}{3!}+\frac{n^4}{4!}+\frac{n^5}{5!}+\frac{n^6}{6!}\] is an integer.