login
Group the natural numbers into blocks of size 2: [1,2], [3,4], ... and reverse the order of the numbers within each block. Then group into blocks of size 3 and reverse the order in each block.
1

%I #14 Oct 16 2023 21:28:35

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

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

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

%N Group the natural numbers into blocks of size 2: [1,2], [3,4], ... and reverse the order of the numbers within each block. Then group into blocks of size 3 and reverse the order in each block.

%C Row 3 of the array in A007062.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,1,0,-1).

%F a(n) = 1 + (n mod 2) + 2*floor(3*floor((n - 1)/3)/2 + (-n mod 3)/2).

%F G.f.: x*(4 + x - 2*x^2 + 3*x^4)/((1 - x)^2*(1 + x)*(1 + x + x^2)). - _Stefano Spezia_, Oct 14 2023

%F a(n+6) = a(n) + 6. - _Joerg Arndt_, Oct 15 2023

%F From _Wesley Ivan Hurt_, Oct 15 2023: (Start)

%F a(n) = n - (-1)^n + 2*cos(2*(n - 1)*Pi/3) + 2*sin(2*(n - 1)*Pi/3)/sqrt(3).

%F a(n) = a(n-2) + a(n-3) - a(n-5) for n >= 6. (End)

%e Group natural numbers into blocks of size 2: [1, 2], [3, 4], [5, 6], ...

%e Reverse the order in each block: [2, 1], [4, 3], [6, 5], ...

%e Group the remaining sequence into blocks of size 3: [2, 1, 4], [3, 6, 5], ...

%e Reverse the order in each block to get a(n): 4, 1, 2, 5, 6, 3, ...

%t Table[1 + Mod[n, 2] + 2 Floor[3 Floor[(n - 1)/3]/2 + Mod[-n, 3]/2], {n, 100}]

%Y Cf. A007062.

%K nonn,easy

%O 1,1

%A _Wesley Ivan Hurt_, Oct 14 2023