Problem

Source:

Tags: AMC, USAJMO, Perfect Squares, permutations, USA(J)MO, xtimmyGgettingflamed



A permutation of the set of positive integers $[n] = \{1, 2, . . . , n\}$ is a sequence $(a_1 , a_2 , \ldots, a_n ) $ such that each element of $[n]$ appears precisely one time as a term of the sequence. For example, $(3, 5, 1, 2, 4)$ is a permutation of $[5]$. Let $P (n)$ be the number of permutations of $[n]$ for which $ka_k$ is a perfect square for all $1 \leq k \leq n$. Find with proof the smallest $n$ such that $P (n)$ is a multiple of $2010$.