Skip to main content
Commonmark migration
Source Link

#JavaScript, 48 47 46 bytes

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

#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

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
added 39 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript, 48 4747 46 bytes

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

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

Try it onlineTry it online

1 byte saved thanks to Arnauld

  • 1 byte saved thanks to Arnauld
  • 1 byte saved thanks to tsh

#JavaScript, 48 47 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))?f(s):s

Try it online

1 byte saved thanks to Arnauld

#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
added 112 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript, 48 47 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))?f(s):s

Try it onlineTry it online

1 byte saved thanks to Arnauld

#JavaScript, 48 47 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))?f(s):s

Try it online

1 byte saved thanks to Arnauld

#JavaScript, 48 47 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))?f(s):s

Try it online

1 byte saved thanks to Arnauld

deleted 1 character in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
added 9 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading