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 2
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/

05AB1E, 15 bytes, user4867444

DMžDFD1s/+;}01P

Try it online!

Explanation

D # duplicate input
 M # push the largest value on the stack (the input)
 žDF # 4096 times do:
 D # current value
 + # added to
 1s/ # input divided by current value
 ; # divide sum by 2
 } # end loop
 01 # push 1
 P # product of the stack
Emigna
  • 53.2k
  • 5
  • 44
  • 164

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