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.

A240595 Look-and-Say table, where in row(n+1) the sorted list of distinct terms of row(n) is preceded by the list of numbers of their occurrences.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 2, 2, 1, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 2, 2, 2, 1, 2, 3, 1, 4, 1, 1, 2, 3, 3, 1, 1, 1, 1, 2, 3, 4, 4, 1, 2, 1, 1, 2, 3, 4, 3, 2, 1, 2, 1, 2, 3, 4, 2, 3, 2, 1, 1, 2, 3, 4, 2, 3, 2, 1, 1, 2, 3, 4, 2, 3, 2, 1, 1, 2, 3, 4, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 08 2014

Keywords

Comments

For n > 13: row(n) = row(13), see example.

Examples

			.  1: [1] -> 1x1 -> [1 | 1] -> row(2)
.  2: [1,1] -> 2x1 -> [2 | 1] -> row(3)
.  3: [2,1] -> 1x1, 1x2 -> [1,1 | 1,2] -> row(4)
.  4: [1,1,1,2] -> 3x1, 1x2 -> [3,1 | 1,2] -> row(5)
.  5: [3,1,1,2] -> 2x1, 1x2, 1x3 -> [2,1,1 | 1,2,3] -> row(6)
.  6: [2,1,1,1,2,3] -> 3x1, 2x2, 1x3 -> [3,2,1 | 1,2,3] -> row(7)
.  7: [3,2,1,1,2,3] -> 2x1, 2x2, 2x3 -> [2,2,2 | 1,2,3] -> row(8)
.  8: [2,2,2,1,2,3] -> 1x1, 4x2, 1x3 -> [1,4,1 | 1,2,3] -> row(9)
.  9: [1,4,1,1,2,3] -> 3x1, 1x2, 1x3, 1x4 -> [3,1,1,1 | 1,2,3] -> row(10)
. 10: [3,1,1,1,1,2,3,4] -> 4x1, 1x2, 2x3, 1x4 -> [4,1,2,1 | 1,2,3,4]
. 11: [4,1,2,1,1,2,3,4] -> 3x1, 2x2, 1x3, 2x4 -> [3,2,1,2 | 1,2,3,4]
. 12: [3,2,1,2,1,2,3,4] -> 2x1, 3x2, 2x3, 1x4 -> [2,3,2,1 | 1,2,3,4]
. 13: [2,3,2,1,1,2,3,4] -> 2x1, 3x2, 2x3, 1x4 -> [2,3,2,1 | 1,2,3,4]
. 14: [2,3,2,1,1,2,3,4] = row(13).
		

Crossrefs

Cf. A034002.

Programs

  • Haskell
    import Data.List (sort, group)
    a240595 n k = a240595_tabf !! (n-1) !! (k-1)
    a240595_row n = a240595_tabf !! (n-1)
    a240595_tabf = iterate f [1] where
       f xs = concat [map length zss, map head zss]
              where zss = group $ sort xs