cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A366619 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.

Original entry on oeis.org

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, 26, 29, 30, 27, 34, 31, 32, 35, 36, 33, 40, 37, 38, 41, 42, 39, 46, 43, 44, 47, 48, 45, 52, 49, 50, 53, 54, 51, 58, 55, 56, 59, 60, 57, 64, 61, 62, 65, 66, 63, 70, 67, 68, 71, 72, 69
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 14 2023

Keywords

Comments

Row 3 of the array in A007062.

Examples

			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, ...
		

Crossrefs

Cf. A007062.

Programs

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

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)