|
|
A034002
|
|
A005150 expanded into single digits.
|
|
7
|
|
|
1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 2, 2, 1, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 1, 1, 3, 2, 1, 3, 2, 1, 1, 3, 1, 1, 3, 1, 2, 1, 1, 1, 3, 1, 2, 2, 1, 1, 3, 2, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 3, 2, 1, 1, 3, 2, 1, 2, 2, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
. 1: 1 1
. 2: 1,1 11
. 3: 2,1 21
. 4: 1,2,1,1 1211
. 5: 1,1,1,2,2,1 111221
. 6: 3,1,2,2,1,1 312211
. 7: 1,3,1,1,2,2,2,1 13112221
. 8: 1,1,1,3,2,1,3,2,1,1 1113213211
. 9: 3,1,1,3,1,2,1,1,1,3,1,2,2,1 31131211131221
-}
|
|
PROG
|
(Haskell) see Watkins link, p. 3.
import Data.List (group)
a034002 n k = a034002_tabf !! (n-1) !! (k-1)
a034002_row n = a034002_tabf !! (n-1)
a034002_tabf = iterate
(concat . map (\xs -> [length xs, head xs]) . group) [1]
(Python)
from sympy import flatten
l=[1]
L=[1]
n=s=1
y=''
while n<21:
x=str(l[n - 1]) + ' '
for i in range(len(x) - 1):
if x[i]==x[i + 1]: s+=1
else:
y+=str(s)+str(x[i])
s=1
x=''
n+=1
l.append(int(y))
L.append([int(a) for a in list(y)])
y=''
s=1
|
|
CROSSREFS
|
See the entry for A005150 for much more about this sequence.
|
|
KEYWORD
|
nonn,base,tabf
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|