A253146 A fractal tree, read by rows: for n > 2, T(n,1) = T(n-1,1)+2, T(n,n) = T(n-1,1)+3, and for k=2..n-1, T(n,k) = T(n-2,k-1).
1, 2, 3, 4, 1, 5, 6, 2, 3, 7, 8, 4, 1, 5, 9, 10, 6, 2, 3, 7, 11, 12, 8, 4, 1, 5, 9, 13, 14, 10, 6, 2, 3, 7, 11, 15, 16, 12, 8, 4, 1, 5, 9, 13, 17, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 20, 16, 12, 8, 4, 1, 5, 9, 13, 17, 21, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23
Offset: 1
Examples
. 1: 1 . 2: 2 3 . 3: 4 1 5 . 4: 6 2 3 7 . 5: 8 4 1 5 9 . 6: 10 6 2 3 7 11 . 7: 12 8 4 1 5 9 13 . 8: 14 10 6 2 3 7 11 15 . 9: 16 12 8 4 1 5 9 13 17 . 10: 18 14 10 6 2 3 7 11 15 19 . 11: 20 16 12 8 4 1 5 9 13 17 21 . 12: 22 18 14 10 6 2 3 7 11 15 19 23 . Removing the first and last entries from each row gives the same tree back again.
Links
- Reinhard Zumkeller, Rows n = 1..125 of triangle, flattened
- Éric Angelini, A fractal tree, SeqFan list, Dec 27 2014.
Programs
-
Haskell
a253146 n k = a253146_tabl !! (n-1) !! (k-1) a253146_row n = a253146_tabl !! (n-1) a253146_tabl = [1] : [2,3] : f [1] [2,3] where f us vs@(v:_) = ws : f vs ws where ws = [v + 2] ++ us ++ [v + 3]
-
Mathematica
T[n_, 1] := 2n - 2; T[n_, n_] := 2n - 1; T[n_, k_] := T[n, k] = T[n-2, k-1]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 20 2021 *)
Comments