[go: up one dir, main page]

login
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
OFFSET
1,4
COMMENTS
A005150(n) = Sum_{k=1..A005341(n)} T(n,k)*10^(A005341(n) - k). - Reinhard Zumkeller, Dec 15 2012
LINKS
J. H. Conway, The weird and wonderful chemistry of audioactive decay, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 173-188. DOI: 10.1007/978-1-4612-4808-8_53.
M. Lothaire, Algebraic Combinatorics on Words, Cambridge, 2002, see p. 36.
Kevin Watkins, Proving Conway's Lost Cosmological Theorem, POP seminar talk, CMU, Dec 2006.
Eric Weisstein's World of Mathematics, Look and Say Sequence
EXAMPLE
. Initial rows A005150
. 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]
-- Reinhard Zumkeller, Aug 09 2012
(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
print(l) # A005150
print(flatten(L)) # Indranil Ghosh, Jul 05 2017
CROSSREFS
See the entry for A005150 for much more about this sequence.
Cf. A088203.
Cf. A005341 (row lengths), A220424 (method B version).
Sequence in context: A322351 A092523 A120891 * A276630 A176048 A359141
KEYWORD
nonn,base,tabf
EXTENSIONS
Offset changed and keyword tabf added by Reinhard Zumkeller, Aug 09 2012
STATUS
approved