From: Jeff Schwab Date: 2009-04-25T10:30:06+09:00 Subject: Re: [QUIZ] Digits of Pi (#202) Joel VanderWerf wrote: > Daniel Moore wrote: >> This week's quiz is to write a Ruby program that can compute the first >> 100,000 digits of �. > > Bonus points for determining the first non-trivial ruby program encoded > in that sequence of digits. Interesting idea! Is there any way of determining whether a given sequence of bytes is a valid ruby program, other than running it? If this were my paternus lingua, C++, I would start by chucking each candidate sequence at a compiler. > (Represent a program source string as a sequence of octal triplets > that is, or is not, a subsequence of the octal representation of �.) What is an "octal triplet?" Do you mean that the integer value of each byte in the source code should be represented by a sequence of three octal digits (e.g. 077 for ?? and 141 for ?a)? I'm curious: Why octal? It seems an odd choice, given that an "octal triplet" corresponds to 9 bits, rather than the 8 in a standard byte. Why not "hex pairs?" Btw, isn't every finite sequence of digits a subsequence of Pi's representation in that base? Or is that unknowable?