Skip to main content
1 of 6
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript, 48 bytes

Input and output as strings. Returns the nth term of the sequence.

f=s=>s==(s=s.replace(/(.)\1/g,x=>x[0]*2))?s:f(s)

Try it online

Shaggy
  • 43.5k
  • 4
  • 36
  • 94