Skip to main content
6 of 6
Commonmark migration

JavaScript, 48 47 46 bytes

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

f=s=>s-(s=s.replace(/(.)\1/g,x=>x/5.5))?f(s):s

Try it online

  • 1 byte saved thanks to Arnauld
  • 1 byte saved thanks to tsh
Shaggy
  • 43.5k
  • 4
  • 36
  • 94