OFFSET
1,1
COMMENTS
Row 3 of the array in A007062.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,1,0,-1).
FORMULA
a(n) = 1 + (n mod 2) + 2*floor(3*floor((n - 1)/3)/2 + (-n mod 3)/2).
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
a(n+6) = a(n) + 6. - Joerg Arndt, Oct 15 2023
From Wesley Ivan Hurt, Oct 15 2023: (Start)
a(n) = n - (-1)^n + 2*cos(2*(n - 1)*Pi/3) + 2*sin(2*(n - 1)*Pi/3)/sqrt(3).
a(n) = a(n-2) + a(n-3) - a(n-5) for n >= 6. (End)
EXAMPLE
Group natural numbers into blocks of size 2: [1, 2], [3, 4], [5, 6], ...
Reverse the order in each block: [2, 1], [4, 3], [6, 5], ...
Group the remaining sequence into blocks of size 3: [2, 1, 4], [3, 6, 5], ...
Reverse the order in each block to get a(n): 4, 1, 2, 5, 6, 3, ...
MATHEMATICA
Table[1 + Mod[n, 2] + 2 Floor[3 Floor[(n - 1)/3]/2 + Mod[-n, 3]/2], {n, 100}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 14 2023
STATUS
approved