Special permutations

We call a positive integer $$n$$ a beautiful number if there exists a permutation $$a_1, ..., a_n$$ of $$1,..., n$$ such that $$\{a_1-1, a_2-2, a_3-3, ..., a_n-n\}$$ and $$\{a_1+1, ..., a_n+n\}$$ are both equivalent to $$\{ 1, 2, ..., n \}$$ modulo $$n$$. How many beautiful numbers are there between 1 and 1000 (inclusive)?

×