We call a permutation σ of the first n positive integers friendly if and only if the following conditions are fulfilled:
(1) σ(k+1)∈{2σ(k),2σ(k)−1,2σ(k)−n,2σ(k)−n−1},∀k∈{1,2,...,n−1}
(2) σ(1)∈{2σ(n),2σ(n)−1,2σ(n)−n,2σ(n)−n−1}.
Find all positive integers n for which there exists such a friendly permutation of the first n positive integers.