Given an input n, output the value of the Fransén-Robinson constant with n digits after the decimal place, with rounding.


  • You may assume that all inputs are integers between 1 and 60.
  • You may not store any related values - the constant must be calculated, not recalled.
  • Rounding must be done with the following criteria:
    • If the digit following the final digit is less than five, the final digit must remain the same.
    • If the digit following the final digit is greater than or equal to five, the final digit must be incremented by one.
  • You must only output the first n+1 digits.
  • Standard loopholes apply.

Test Cases

>>> f(0)

>>> f(1)

>>> f(11)

>>> f(50)

>>> f(59)

>>> f(60)
  • \$\begingroup\$ What if you do not have support for arbitrary precision floats? \$\endgroup\$ – flawr May 27 '16 at 22:10
  • 1
    \$\begingroup\$ @flawr I suppose that the language would have to use some form of string concatenation or similar. Otherwise, it may not be the language for this challenge. \$\endgroup\$ – Addison Crump May 27 '16 at 22:11
  • \$\begingroup\$ Too bad, that basically only leaves us with hardcoding the numbers. PS: Why don't you add f(60) to the test cases? That way participants wouldn't have to fetch it externally=) \$\endgroup\$ – flawr May 27 '16 at 22:14
  • \$\begingroup\$ @flawr Hardcoding is disallowed by rule 2. \$\endgroup\$ – Addison Crump May 27 '16 at 22:15
  • \$\begingroup\$ Are trailing zeroes ok? \$\endgroup\$ – Mego May 27 '16 at 23:41

Mathematica, 44 39 36 25 UTF-8 bytes

  • -5 bytes thanks to Sp3000
  • -3 bytes thanks to kennytm
  • -11 bytes thanks to senegrom

Crossed out 44 is still regular 44!!




Outputs 2.81.


N[               , # + 1] 

First step takes Numeric of the rest, with # (first parameter) + 1 precision. ! (factorial) does what you'd expect. {x, -1, Infinity} sets the bounds for the (strangely formatted) Integral.

  • \$\begingroup\$ I can't test this, so I assume this rounds correctly? \$\endgroup\$ – Addison Crump May 27 '16 at 23:03
  • 1
    \$\begingroup\$ @VTCAKAVSMoACE I checked for n = 60, it rounds correctly. (The 61st digit is an 8). You can look at Wolfram's docs for N. \$\endgroup\$ – NoOneIsHere May 27 '16 at 23:04
  • \$\begingroup\$ Coolio. Just checking. \$\endgroup\$ – Addison Crump May 27 '16 at 23:04
  • \$\begingroup\$ You can probably use a literal in place of Infinity. I'd suggest dividing by 0, if that didn't produce ComplexInfinity instead... \$\endgroup\$ – Sp3000 May 28 '16 at 4:44
  • 1
    \$\begingroup\$ try N[∫1/x!{x,-1,∞},#+1]& where is Unicode-F74C; displays as 𝕕 in Mathematica. (note that the space before & is also not necessary...) \$\endgroup\$ – senegrom Jun 2 '16 at 11:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.