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.

A243573 Irregular triangular array generated as in Comments; contains every positive integer exactly once.

Original entry on oeis.org

1, 2, 4, 3, 5, 8, 16, 6, 9, 12, 17, 20, 32, 64, 7, 10, 13, 18, 21, 24, 33, 36, 48, 65, 68, 80, 128, 256, 11, 14, 19, 22, 25, 28, 34, 37, 40, 49, 52, 66, 69, 72, 81, 84, 96, 129, 132, 144, 192, 257, 260, 272, 320, 512, 1024, 15, 23, 26, 29, 35, 38, 41, 44, 50
Offset: 1

Views

Author

Clark Kimberling, Jun 07 2014

Keywords

Comments

Decree that (row 1) = (1), (row 2) = (2, 4), (row 3) = (3,5,8,16), (row 4) = (6,9,12,17,20,32,64). Let r(n) = A001563(n+3), so that r(r) = r(n-1) + r(n-2) + r(n-3) + r(n-4) with r(1) =1, r(2) = 2, r(3) = 4, r(4) = 7. Row n of the array, for n >= 5, consists of the numbers, in increasing order, defined as follows: all 4*x from x in row n-1, together with all 1 + 4*x from x in row n-2, together with all 2 + 4*x from x in row n-3, together with all 3 + 4*x for x in row n-4. Thus, the number of numbers in row n is r(n), a tetranacci number. Every positive integer occurs exactly once in the array, so that the resulting sequence is a permutation of the positive integers.

Examples

			First 5 rows of the array:
1
2 .. 4
3 .. 5 .. 8 .. 16
6 .. 9 .. 12 . 17 . 20 . 32 . 64
7 .. 10 . 13 . 18 . 21 . 24 . 33 . 36 . 48 . 65 . 68 . 80 . 128 . 256
		

Crossrefs

Programs

  • Mathematica
    z = 8; g[1] = {1}; f1[x_] := x + 1; f2[x_] := 4 x; h[1] = g[1];
    b[n_] := b[n] = DeleteDuplicates[Union[f1[g[n - 1]], f2[g[n - 1]]]];
    h[n_] := h[n] = Union[h[n - 1], g[n - 1]];
    g[n_] := g[n] = Complement [b[n], Intersection[b[n], h[n]]]
    u = Table[g[n], {n, 1, z}]; v = Flatten[u] (* A243573 *)