From all possible permutations from $(a_1,a_2,...,a_n)$ from the set $\{1,2,..,n\}$, $n\geq 1$, consider the sets that satisfies the $2(a_1+a_2+...+a_m)$ is divisible by $m$, for every $m=1,2,...,n$. Find the total number of permutations.
Problem
Source:
Tags: combinatorics, permutations, Permutations with restrictions, Sets, national olympiad, Olympiad