Post History
JavaScript (Node.js), 27 22 bytes
-5 bytes thanks to Hakerh400
Direct computation
f=n=>(n+(n*n+4)**.5)/2
Answer
#3: Post edited
# [JavaScript (Node.js)], 27 bytes- Direct computation
- ```
f=n=>(n+Math.sqrt(n*n+4))/2- ```
\$\$\frac{n+\sqrt{n^2+4}}{2}$\$[Try it online!][TIO-klbltam0]- [JavaScript (Node.js)]: https://nodejs.org
[TIO-klbltam0]: https://tio.run/##FcVNDsIgEAbQtT3Ft3PGSetP3FV6Aw9BKiiGDBWIG@PZsW7ee9q3LXMOS@013Vxr3qiZSOVq62Mor1xJdypn5v2p@ZRB0VUEGBzGtQuO/0UYn24zJy0puiGmOwUItuinFYGnwDx23/YD "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], <s>27</s> 22 bytes
- *-5 bytes thanks to Hakerh400*
- Direct computation
- ```
- f=n=>(n+(n*n+4)**.5)/2
- ```
- $$\frac{n+\sqrt{n^2+4}}{2}$$
- [Try it online!][TIO-klbxiprt]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-klbxiprt]: https://tio.run/##FcVBDoIwEAXQtZzi75zpBBSjKyx3IdiSmmbGFOLGePaKm/ee03ta55JeW6v2CLVGr34kFVKncmXnuhufLjVaAeWwIcHjPOzd0f8XYXyaw2y6Wg5dtoUSBEe0444gUmIemm/9AQ "JavaScript (Node.js) – Try It Online"
#2: Post edited
- # [JavaScript (Node.js)], 27 bytes
- Direct computation
- ```
- f=n=>(n+Math.sqrt(n*n+4))/2
- ```
$\frac{n+\sqrt{n^2+4}{2}$- [Try it online!][TIO-klbltam0]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-klbltam0]: https://tio.run/##FcVNDsIgEAbQtT3Ft3PGSetP3FV6Aw9BKiiGDBWIG@PZsW7ee9q3LXMOS@013Vxr3qiZSOVq62Mor1xJdypn5v2p@ZRB0VUEGBzGtQuO/0UYn24zJy0puiGmOwUItuinFYGnwDx23/YD "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], 27 bytes
- Direct computation
- ```
- f=n=>(n+Math.sqrt(n*n+4))/2
- ```
- $\$\frac{n+\sqrt{n^2+4}}{2}$$
- [Try it online!][TIO-klbltam0]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-klbltam0]: https://tio.run/##FcVNDsIgEAbQtT3Ft3PGSetP3FV6Aw9BKiiGDBWIG@PZsW7ee9q3LXMOS@013Vxr3qiZSOVq62Mor1xJdypn5v2p@ZRB0VUEGBzGtQuO/0UYn24zJy0puiGmOwUItuinFYGnwDx23/YD "JavaScript (Node.js) – Try It Online"
#1: Initial revision
# [JavaScript (Node.js)], 27 bytes Direct computation ``` f=n=>(n+Math.sqrt(n*n+4))/2 ``` \$\frac{n+\sqrt{n^2+4}{2}\$ [Try it online!][TIO-klbltam0] [JavaScript (Node.js)]: https://nodejs.org [TIO-klbltam0]: https://tio.run/##FcVNDsIgEAbQtT3Ft3PGSetP3FV6Aw9BKiiGDBWIG@PZsW7ee9q3LXMOS@013Vxr3qiZSOVq62Mor1xJdypn5v2p@ZRB0VUEGBzGtQuO/0UYn24zJy0puiGmOwUItuinFYGnwDx23/YD "JavaScript (Node.js) – Try It Online"