Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

2 of 3
saved 1 byte
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), (削除) 66 (削除ここまで) 65 bytes

Returns the \$n\$-th term, 0-indexed.

Uses @Neil's trick.

n=>(g=a=>i<2*n?g([s,...a.map(x=>s+=a[--j],j=i++)]):s>>n)([i=s=1])

Try it online!

Arnauld
  • 205.5k
  • 21
  • 187
  • 670

AltStyle によって変換されたページ (->オリジナル) /