login
Similar to A093506, but starting with 2, 4.
1

%I #28 Aug 29 2024 18:31:48

%S 2,4,1,3,5,7,6,9,11,13,8,10,12,14,16,15,17,19,21,23,25,27,18,20,22,24,

%T 26,28,29,31,33,35,37,39,41,43,45,30,32,34,36,38,40,42,44,46,48,50,47,

%U 49,51,53,55,57,59,61,63,65,67,69,71,52,54,56,58,60,62,64,66

%N Similar to A093506, but starting with 2, 4.

%C Maximal runs of constant parity: (2,4),(1,3,5,7),(6),(9,11,13),(8,10,12,14,16),(15,17,19,21,23,25,27),(18,20,22,24,26,28),...

%C Lengths of the runs: 2, 4, 1, 3, 5, 7, 6,..., which is the sequence itself (and a permutation of the natural numbers).

%D From a posting to the Sequence Fans Mailing List by Eric Angelini, Nov 22 2010

%H Carl R. White, <a href="/A173658/b173658.txt">Table of n, a(n) for n = 1..10000</a>

%o (bc) /*GNU bc*/ maxarray=2^16;print a[1]=2,", ",oe[k=0]=a[p=n=2]=4,", ";oe[1]=-1;max=100;for(;p<maxarray&&n<max;p++)for(i=0*k=!k;i<a[p]&&n<max;i++){an=oe[k]+=2;if(++n<maxarray)a[n]=an;print an,", "};print"\n"

%Y Cf. A001462, A093506.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Nov 24 2010