login
Triangle read by rows: A007651 expanded into single digits.
4

%I #6 Jul 13 2013 12:04:35

%S 1,1,1,1,2,1,1,2,1,1,2,2,1,1,1,1,1,2,2,1,3,1,2,2,2,1,1,3,1,1,1,2,3,1,

%T 2,3,1,1,1,1,2,2,1,3,1,1,1,2,1,3,1,1,3,1,1,2,2,1,1,3,1,1,3,2,1,1,1,3,

%U 1,1,2,3,1,1,2,2,2,1,2,3,1,1,2,3,1,2

%N Triangle read by rows: A007651 expanded into single digits.

%C A007651(n) = sum{T(n,k)*10^(A005341(n)-k): k=1..A005341(n)}.

%H Reinhard Zumkeller, <a href="/A220424/b220424.txt">Rows n = 1..25 of triangle, flattened</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LookandSaySequence.html">Look and Say Sequence</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Look-and-say_sequence">Look-and-say sequence</a>

%e . Initial rows A007651

%e . 1: 1 1

%e . 2: 1,1 11

%e . 3: 1,2 12

%e . 4: 1,1,2,1 1121

%e . 5: 1,2,2,1,1,1 122111

%e . 6: 1,1,2,2,1,3 112213

%e . 7: 1,2,2,2,1,1,3,1 12221131

%e . 8: 1,1,2,3,1,2,3,1,1,1 1123123111

%e . 9: 1,2,2,1,3,1,1,1,2,1,3,1,1,3 12213111213113 .

%o (Haskell)

%o import Data.List (group)

%o a220424 n k = a220424_tabf !! (n-1) !! (k-1)

%o a220424_row n = a220424_tabf !! (n-1)

%o a220424_tabf = iterate

%o (concatMap (\xs -> [head xs, length xs]) . group) [1]

%Y Cf. A005341 (row lengths), A034002 (method A version).

%K nonn,base,tabf

%O 1,5

%A _Reinhard Zumkeller_, Dec 15 2012