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.

A240769 Triangle read by rows: T(1,1) = 1; T(n+1,k) = T(n,k+1), 1 <= k < n; T(n+1,n) = 2*T(n,1); T(n+1,n+1) = 2*T(n,1) - 1.

Original entry on oeis.org

1, 2, 1, 1, 4, 3, 4, 3, 2, 1, 3, 2, 1, 8, 7, 2, 1, 8, 7, 6, 5, 1, 8, 7, 6, 5, 4, 3, 8, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 16, 15, 6, 5, 4, 3, 2, 1, 16, 15, 14, 13, 5, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 10, 9, 3, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 13 2014

Keywords

Comments

Let h be the initial term of row n, to get row n+1, remove h and then append 2*h and 2*h+1;
A080079(n) = T(n,1); T(n,T(n,1)) = 1.

Examples

			.   1:   1
.   2:   2   1
.   3:   1   4   3
.   4:   4   3   2   1
.   5:   3   2   1   8   7
.   6:   2   1   8   7   6   5
.   7:   1   8   7   6   5   4   3
.   8:   8   7   6   5   4   3   2   1
.   9:   7   6   5   4   3   2   1  16  15
.  10:   6   5   4   3   2   1  16  15  14  13
.  11:   5   4   3   2   1  16  15  14  13  12  11
.  12:   4   3   2   1  16  15  14  13  12  11  10   9 .
		

Crossrefs

Cf. A062383 (row maxima).

Programs

  • Haskell
    a240769 n k = a240769_tabl !! (n-1) !! (k-1)
    a240769_row n = a240769_tabl !! (n-1)
    a240769_tabl = iterate (\(x:xs) -> xs ++ [2*x, 2*x-1]) [1]