Khinchin's constant to as many decimal places as possible in 64 bytes or less
CJam - 118
2'."*;TeT?_aN{.i9B*ZEay
G`9~eW}nE=Lr-`B} )D>9m9"136b
Try it at http://cjam.aditsu.net/
Since stackexchange destroys some of the characters, here's a program that generates the program above; run it first, then run its output:
"2'.\""685452001065306445309714835481795693820382293994462953051152345557218859537152002801141174931847697995153465905288090 136b:c"\"136b"
Explanation:
2
pushes 2
'.
pushes the dot
"…"
is a string containing the rest of the digits in encoded form
128b
converts the string to a number, treating the characters as digits in base 128 (via their ASCII code)
Maple, 200+
The following Maple command computes Khinchin's constant to the requested precision (here, 200 digits):
evalf[200](exp(sum((-1)^k*(2-2^k)*ζ(1,k)/k,k=2..∞)/ln(2)));
This code should work if you copy-paste it into the Maple graphical interface. The ζ
takes two bytes in UTF-8, and the ∞
three, for a total of 62 bytes.
Writing out the ASCII versions of those symbols, even with the trick of using min()
instead of infinity
, alas, brings the byte count up to 66:
evalf[200](exp(sum((-1)^k*(2-2^k)*Zeta(1,k)/k,k=2..min())/ln(2)));
The number of digits computed can be easily adjusted by changing the number in square brackets after evalf
. On my rather old computer, 200 digits seems to finish in about half an hour; yours might be capable of more. Note that Maple rounds the result to the requested precision instead of truncating it, so the actual number of matching digits might be somewhat less.
This method of calculating the constant is based on formula (9) from the MathWorld page, cited there to Gosper (1996, pers. comm.):
This was the most efficient method that I managed to (barely) squeeze into 64 bytes or less.
Kona 63
Simple hard-coded answer:
2.68545200106530644530971483548179569382038229399446295305115234