OFFSET
1,1
COMMENTS
Method A = 'frequency' followed by 'digit'-indication.
No digit exceeds 3. If the starting number a(1) is a single-digit number greater than 3 this will remain as the last digit, all the remaining in any term being no greater than 3. - Carmine Suriano, Sep 07 2010
a(n) = value of concatenation of n-th row in A088203. - Reinhard Zumkeller, Aug 09 2012
This is because for all n > 1, a(n) begins with 1 or 3 and ends with 2. - Jean-Christophe Hervé, May 07 2013
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015
REFERENCES
S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.
LINKS
T. D. Noe, Table of n, a(n) for n=1..20
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.
S. R. Finch, Conway's Constant [Broken link]
S. R. Finch, Conway's Constant [From the Wayback Machine]
Eric Weisstein's World of Mathematics, Look and Say Sequence
FORMULA
a(n+1) = A045918(a(n)). - Reinhard Zumkeller, Aug 09 2012
EXAMPLE
E.g. the term after 3112 is obtained by saying "one 3, two 1's, one 2", which gives 132112.
MATHEMATICA
RunLengthEncode[ x_List ] := (Through[ {First, Length}[ #1 ] ] &) /@ Split[ x ]; LookAndSay[ n_, d_:1 ] := NestList[ Flatten[ Reverse /@ RunLengthEncode[ # ] ] &, {d}, n - 1 ]; F[ n_ ] := LookAndSay[ n, 2 ][ [ n ] ]; Table[ FromDigits[ F[ n ] ], {n, 11} ] (* Zerinvary Lajos, Mar 21 2007 *)
PROG
(Haskell)
a006751 = foldl1 (\v d -> 10 * v + d) . map toInteger . a088203_row
-- Reinhard Zumkeller, Aug 09 2012
(Perl)
# This outputs the first n elements of the sequence, where n is given on the command line.
$s = 2;
for (2..shift @ARGV) {
print "$s, ";
$s =~ s/(.)\1*/(length $&).$1/eg;
}
print "$s\n";
## Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
(Python)
l=[2]
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))
y=''
s=1
print(l) # Indranil Ghosh, Jul 05 2017
CROSSREFS
KEYWORD
nonn,base,easy,nice
AUTHOR
STATUS
approved