%I #8 Dec 23 2024 14:53:42
%S 1,2,3,4,6,7,5,8,10,11,9,12,13,15,16,14,18,19,17,20,21,23,24,22,26,27,
%T 25,28,29,31,32,30,33,34,35,36,37,39,40,38,42,43,41,44,45,47,48,46,49,
%U 50,51,52,53,55,56,54,58,59,57,60,61,63,64,62,65,66,67,68,70,71,69,72,74,75,73
%N Lexicographically earliest permutation of the positive integers such that a(n+a(n)+1) has the same parity as a(n).
%C a(n+a(n)+1) is the term reached by "jumping over" a(n) terms to the right of a(n).
%H E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2012-April/016773.html">Small perturbations in the natural flow</a>, SeqFan list, Apr 12 2012
%e a(1)=1 means that jumping over its neighbor we will land on a(3) which must have the same parity as a(1).
%e a(2)=2 means that jumping over a(3), a(4), we will land on a(5) which must be even, as is a(2). Therefore a(5) cannot equal 5 (which would be the least available number not yet used), the least possible choice is a(5)=6 (after having filled in a(3) with the least unused odd number, and a(4) with the least unused number without restriction).
%o (PARI) {R=vector(222);u=0; for(n=1,100, a=0; while( bittest(u,a++) || (R[n] &(a+R[n])%2) || (R[n+a+1] & (a+R[n+a+1])%2),); u+=1<<R[n]=a; R[n+a+1]=bittest(a,0)-2); vecextract(R,"1..100")}
%K nonn
%O 1,2
%A _Eric Angelini_ and _M. F. Hasler_, Apr 12 2012