[Question]
  [
The "Look and say" or "Say what you see" sequence is a series of numbers where each describes the last.
```
1
11 (one one)
21 (two ones)
1211 (one two, one one)
111221 (one one, one two, two ones)
312211 (three ones, two twos, one one)
```
and on and on...
<https://oeis.org/A005150>
Anyway, this is a regular code golf challenge (least byte count wins) to make a program that takes two arguments, an initial number and the amount of iterations. For example if you plugged in "1" and "2" the result would be "21". If you plugged in "2" and "4" the result would be "132112". Have fun!
  
[Answer]
## Pyth, ~~10~~ 8 bytes
*-2 bytes by @FryAmTheEggman*
```
ussrG8Qz
```
Explanation:
```
            Implicit: z=first line as string, Q=second line
u         the result of reducing lambda G:
  s s rG8   flattened run-length-encoded G
  Q       Q times
  z     starting with z
  
```
Try it [here](http://pyth.herokuapp.com/?code=jkusrG8Q%5DE&input=4%0A2&debug=0).
[Answer]
## CJam, 8 bytes
```
q~{se`}*
```
Input format is the initial number first, iterations second, separated by some whitespace.
[Test it here.](http://cjam.aditsu.net/#code=q~%7Bse%60%7D*&input=2%204)
### Explanation
```
q~   e# Read and evaluate input, dumping both numbers on the stack.
{    e# Run this block once for each iteration...
  s  e#   Convert to string... in the first iteration this just stringifies the input
     e#   number again. In subsequent iterations it flattens and then stringifies the
     e#   array we get from the run-length encoding.
  e` e#   Run-length encode.
}*
```
The array is also flattened before being printed so the result is just the required number.
[Answer]
# JavaScript, 57 bytes
```
F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a
```
Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.
[Answer]
## R, 87 bytes
```
function(a,n){for(i in 1:n){r=rle(el(strsplit(a,"")));a=paste0(r$l,r$v,collapse="")};a}
```
**Ungolfed & explained**
```
f=function(a,n){
    for(i in 1:n){                      # For 1...n
        r=rle(el(strsplit(a,"")))       # Run length encoding
        a=paste0(r$l,r$v,collapse="")   # concatenate length vector and values vector and collapse
    };
    a                                   # print final result
}
```
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 9 bytes
```
:"Y'wvX:!
```
Inputs are: number of iterations, initial number.
[**Try it online!**](http://matl.tryitonline.net/#code=OiJZJ3d2WDoh&input=NAoyCg)
```
:      % implicit input: number of iterations. Create vector with that size
"      % for loop
  Y'   %   RLE. Pushes two arrays: elements and numbers of repetitions.
       %   First time implicitly asks for input: initial number
  w    %   swap
  v    %   concatenate vertically
  X:   %   linearize to column array
  !    %   transpose to row array
       % implicitly end loop
       % implicitly display
```
[Answer]
# Ruby, 63 bytes
A full program, since the question seems to ask for that. Takes input as command line arguments.
```
i,n=$*
n.to_i.times{i=i.gsub(/(.)\1*/){"#{$&.size}#$1"}}
puts i
```
No, `gsub!` can't be used, since the strings in `$*` are frozen :/
[Answer]
# [R](https://www.r-project.org/), ~~61~~ 57 bytes
-4 thanks to @JayCe, just when I was sure it couldn't be done any simpler!
```
f=function(a,n)`if`(n,f(t(sapply(rle(c(a)),c)),n-1),c(a))
```
[Try it online!](https://tio.run/##K/r/P802rTQvuSQzP08jUSdPMyEzLUEjTydNo0SjOLGgIKdSoygnVSNZI1FTUycZiPN0DYEMEPd/moahjqGB5n8A "R – Try It Online")
[Answer]
# Perl 6, 63 bytes
```
say (@*ARGS[0],*.trans(/(.)$0*/=>{$/.chars~$0})…*)[@*ARGS[1]]
```
This is as short as I could get it for now, there might be some tricky flags that could reduce it, I'm not sure
[Answer]
# [Retina](https://github.com/mbuettner/retina), ~~46~~ ~~45~~ 27 bytes
Martin did lots to help golf this.
```
+`(\d)(\1?)*(?=.*_)_?
$#2$1
```
[**Try it online**](http://retina.tryitonline.net/#code=K2AoXGQpKFwxPykqKD89LipfKV8_CiQjMiQx&input=MTIxMV9fXw)
Takes input in the format:
```
<start><count>
```
`<start>` is the initial number.
`<count>` is in unary, all underscores, and is how many iterations are performed.
### Single iteration, ~~20~~ 16 bytes:
```
(\d)(\1?)*
$#2$1
```
[Answer]
# [Haskell](https://www.haskell.org/), 62 bytes
```
import Data.List
0%y=y
x%y=do x<-group$(x-1)%y;[length x,x!!0]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMElsSRRzyezuITLQLXStpKrAkim5CtU2OimF@WXFqhoVOgaaqpWWkfnpOall2QoVOhUKCoaxP7PTczMsy0oyswrUTFTjTaM/Q8A "Haskell – Try It Online")
[Answer]
# JavaScript ES6, 71 bytes
```
(m,n)=>[...Array(n)].map(_=>m=m.replace(/(.)\1*/g,x=>x.length+x[0]))&&m
```
Takes input as a string and a number.
[Answer]
# Perl 5, 50 bytes
```
$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say
```
The arguments are in reverse order (number of iterations then seed). Example:
```
> perl -E'$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say' 4 2
132112
> perl -E'$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say' 0 2
2
> perl -E'$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say' 2 0
1110
> perl -E'$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say' 1 10
1110
> perl -E'$_=pop;for$i(1..pop){s/(.)\1*/length($&).$1/ge}say' 11 1
3113112221232112111312211312113211
```
[Answer]
# Python 3.6, ~~100~~ ~~98~~ 93 bytes
```
import re
f=lambda s,n:n and eval("f'"+re.sub(r'((.)\2*)',r'{len("\1")}\2',f(s,n-1))+"'")or s
```
[Try it online!](https://tio.run/##DctBCsMgEADAe1@x2MPuNjagIZdCf@LFEKUBo2G1hVL6dtu5z/Fuj5Kn3rf9KNJAwinek9@X1UPV@ZbB5xXCyydSEdUgYazPhQSJRnb2wqgFPylkUs4o/jqLOtJ/Xg3zoFBxEaj9kC03ioQGNczMcMbJWGsM9h8 "Python 3 – Try It Online")
Note this creates a lambda that takes a string and an integer, and returns a string. Example: `f('1', 5) == '312211'`
Finds all repeated characters (`((.)\2*)` regex), makes a f-string out of their length and the character itself (`r'{len("\1")}\2'`), then evaluates it. Uses recursion on the counter (`n and ...f(s,n-1)... or s`) to avoid having to define a proper function and a loop.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ŒrUFµ¡
```
[Try it online!](https://tio.run/nexus/jelly#@390UlGo26Gthxb@///f6L8JAA "Jelly – TIO Nexus")
```
           Implicit input: first argument.
     µ¡    Do this to it <second argument> times:
Œr            Run-length encode into [value, times] pairs
  U           Flip them
   F          Flatten list
    
```
[Answer]
## Perl, 38 + 2 bytes
```
for$i(1..<>){s/(.)\1*/(length$&).$1/ge}
```
Requires the `-p` flag:
```
$ perl -pe'for$i(1..<>){s/(.)\1*/(length$&).$1/ge}' <<< $'1\n5'
312211
```
Input is a multi line string:
```
input number
numbers of iterations
```
If all the steps are required as well then we can change it to the following, which is 44 + 2 bytes:
```
$ perl -nE'for$i(1..<>){s/(.)\1*/(length$&).$1/ge,print}' <<< $'1\n5'
11
21
1211
111221
312211
```
[Answer]
# Mathematica, ~~81~~ 73 bytes
```
FromDigits@Nest[Flatten[(Tally/@Split@#)~Reverse~3]&,IntegerDigits@#,#2]&
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 9 bytes (Non-competing)
*Corrected due to Emigna's comments, see below/edits.*
```
F.¡vygyÙJ
```
[Try it online!](https://tio.run/nexus/05ab1e#@@@md2hhWWV65eGZXv//G3MZGhqZGBubmJqampkYAwA "05AB1E – TIO Nexus")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 10 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
Çα▲ì4↔┌j█♀
```
[Run and debug online!](https://staxlang.xyz/#c=DE%7CR%7Brm%3Af%24e&i=1+2%0A2+4&a=1&m=2)
Spent too many bytes on proper IO format ...
## Explanation
Uses the unpacked version to explain.
```
DE|R{rm:f$e
D              Do `2nd parameter` times
 E             Convert number to digits
                   Starting from the `1st parmeter`
  |R           Convert to [element, count] pairs for each run
    {rm        Revert each pair
       :f      Flatten the array
         $     Convert array to string of digits
          e    Convert string of digits to integer
```
The essential part is `D|R{rm:f`(8 bytes).
If the first input can be taken as an array of digits, the whole program can be written in 9 bytes: [Run and debug online!](https://staxlang.xyz/#p=8d5bc0b76848a0fdc6&i=%5B1%5D+2%0A%5B2%5D+4&a=1&m=2)
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), 30 bytes
```
{y{,/{(#x;*x)}'(&~=':x)_x}/,x}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqrqyWke/WkO5wlqrQrNWXUOtzlbdqkIzvqJWX6ei9n@IVbVKdGVdkVWagp5ChXVCfra1RkJaYmaOdYV1pXWRZmwtV0i0oYKptbGCoYIREBoqGMYChYwUTKwNFYwhAgpGsf8B "K (ngn/k) – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 26 bytes
```
2&([:;](#<@,{.);.1~1,~:/\)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/jdQ0oq2sYzWUbRx0qvU0rfUM6wx16qz0YzT/a3JxpSZn5CsYAqGuFZBIUzCEiBhBRIwQIoZgMbCoMbKoIVgGqt4EIWMMFwfLmIJluPyc9BRyE7NTFYpLi1IVMksUyvOLsosV0orycxUS8yoViksSi0oUCvIz80qwGgN2IsLO/wA "J – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
FÅγøí˜
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f7XDruc2Hdxxee3rO//8mXEYA "05AB1E – Try It Online")
```
FÅγøí˜  # full program
F       # for N in [0, 1, ...,
        # ..., implicit input...
F       # ... minus 1]...
     ˜  # flatten...
   ø    # zipped...
 Åγ     # list of chars used in runs of the same char in...
        # implicit input...
 Åγ     # or top of stack if not first iteration...
   ø    # with...
 Åγ     # list of lengths of runs of the same char in...
        # implicit input...
 Åγ     # or top of stack if not first iteration...
    í   # with each element of the list reversed
        # (implicit) exit loop
        # implicit output
```
`øí` can also be `sø` with no change in functionality. [Try it online!](https://tio.run/##yy9OTMpM/f/f7XDruc3Fh3ecnvP/vwmXEQA "05AB1E – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 11 bytes
```
!¡(dṁ§eL←gd
```
[Try it online!](https://tio.run/##yygtzv7/X/HQQo2UhzsbDy1P9XnUNiE95f///4b/zQA "Husk – Try It Online")
```
!              # get the arg2-th element of
 ¡             # the infinite list by repeatedly applying
               # (starting with arg1):
  (d           # get the digits of
    ṁ          # applying to each of 
         gd    # the groups of identical neighbouring digits:
     §eL←      # combine length + first element
```
[Answer]
# [Go](https://go.dev), 175 bytes
```
import."fmt"
func g(n int,s string)string{for N:=0;N<n;N++{c,o,f,k:=1,"",rune(s[0]),s[1:]+"_"
for _,r:=range k{if r==f{c++}else{o+=Sprintf("%d%c",c,f);f,c=r,1}}
s=o}
return s}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LY89asQwFIR7neIhWJDQS7BJE-xVsRcwgZTLshjFMsJryUhyJXSSNCaQLpDz5DbR_lTz4DHfzHx-jW77WXo19eMAc2_s9xr10-vfr5kX5-Mz1XOkRK9WwcgsGBsxQIje2JHfJWnnoWtk1XZ723ZCJIUONU6NrJFS9KsdWDhWJ47hWDcnQc8FWDxn9I30vS3BUzIavJQ6KSHycAlDckK-L4UfNaO7j52iqFDzVqOSHuucSZAuEz_E1VsI-VH7cGt63cE4pFuMgUZC3RbdS3ipyiFEeb1d2RfLDJZhBmlNOSeZPEDbdtd_)
A non-recursive port of [Ogaday's answer](https://codegolf.stackexchange.com/a/71043/77309).
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 41 bytes
Takes curried arguments with number of iterations first.
```
:**&(~(:gsub+:+%[:+@|S,~:[]&0])&/(.)\1*/)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWNzWttLTUNOo0rNKLS5O0rbRVo620HWqCdeqsomPVDGI11fQ19DRjDLX0NSEa1hWUlhQruEWbxEYrGSnFQgQXLIDQAA)
## Non-regex solution, 47 bytes
```
:**&(A|:slice_when+:!=|:*&-[:+@,~:[]&0]|~:*&"")
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWN_WttLTUNBxrrIpzMpNT48szUvO0rRRta6y01HSjrbQddOqsomPVDGJr6oAiSkqaEG3rCkpLihXcok1io5WMlGIhggsWQGgA)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 31 [bitsv2](https://github.com/Vyxal/Vyncode/blob/main/README.md), 3.875 bytes
```
(øeRf
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2&c=1#WyI9IiwiIiwiKMO4ZVJmIiwiIiwiNFxuMiJd)
Bitstring:
```
0011010110011001011100101001100
```
inputs are reversed
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-h`](https://codegolf.meta.stackexchange.com/a/14339/), 14 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
ÆV=ìÈòÎcÈâ iXÊ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWg&code=xlY97MjyzmPI4iBpWMo&input=NAoy)
[Answer]
# YASEPL, 132 bytes
```
=p'=n'(+`2£s©1`1=q)""=x=l®"p"`3=t$x!h¥t,"p"`4!x+}1,l,5!y¥x,"p"}3,h,4`5!f$x-tſ""!q+f+h!x}2,l,3!n-!p$q<!o$p(!s©o!pſ""!n}!s<!i+}2,n,2
```
prompts you twice. enter starting number and amount of iterations
[Answer]
# Python 3, 138 bytes
I used a recursive approach.
```
def g(a,b):
 if b<1:return a
 else:
  c,n=1,'';f,*a=str(a)+'_'
  for i in a:
   if i==f:c+=1
   else:n+=str(c)+f;f,c=i,1
  return g(n,b-1)
```
The function accepts two ints, `a` and `b` as described.
I'm amazed at how terse the entries here are! Maybe someone will come along with a better Python method too.
[Answer]
# [Pylons](https://github.com/morganthrapp/Pylons-lang), 11
```
i:At,{n,A}j
```
How it works:
```
i      # Get input from command line.
:A     # Initialize A
  t    # Set A to the top of the stack.
,      # Pop the top of the stack.
{      # Start a for loop.
 n     # Run length encode the stack.
  ,    # Seperate command and iteration
   A   # Repeat A times.
    }  # End for loop.
j      # Join the stack with '' and print it and then exit. 
```
[Answer]
# SmileBASIC, ~~100~~ 98 bytes
```
DEF S N,T?N
WHILE""<N
C=C+1C$=SHIFT(N)IF C$!=(N+@L)[0]THEN O$=O$+STR$(C)+C$C=0
WEND
S O$,T-T/T
END
```
Prints out all the steps.
`T/T` is there to end the program when T is 0.
]