A366626 Group the natural numbers into blocks of size 2: [1,2], [3,4], ... and then reverse the order of the numbers within each block. Then group and reverse for each block size up to 4.
5, 2, 1, 4, 7, 10, 3, 6, 9, 12, 11, 8, 17, 14, 13, 16, 19, 22, 15, 18, 21, 24, 23, 20, 29, 26, 25, 28, 31, 34, 27, 30, 33, 36, 35, 32, 41, 38, 37, 40, 43, 46, 39, 42, 45, 48, 47, 44, 53, 50, 49, 52, 55, 58, 51, 54, 57, 60, 59, 56, 65, 62, 61, 64, 67, 70, 63, 66, 69, 72, 71
Offset: 1
Examples
Group natural numbers into blocks of 2: [1, 2], [3, 4], [5, 6], [7, 8], ... Reverse the order in each block: [2, 1], [4, 3], [6, 5], [8, 7], ... Group the remaining sequence into blocks of 3: [2, 1, 4], [3, 6, 5], ... Reverse the order in each block: [4, 1, 2], [5, 6, 3], ... Group the remaining sequence into blocks of 4: [4, 1, 2, 5], [6, 3, 10, 7], Reverse the order in each block to get a(n): 5, 2, 1, 4, 7, 10, 3, 6, ...
Links
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-2,2,-2,2,-2,2,-1).
Programs
-
Mathematica
Table[1 + Mod[n + 1, 2] + 2 Floor[3 Floor[((1 + 4 Floor[(n - 1)/4] + Mod[-n, 4]) - 1)/3]/2 + Mod[-(1 + 4 Floor[(n - 1)/4] + Mod[-n, 4]), 3]/2], {n, 100}]
Comments