OK, here's the sentence:
This sentence has seven hundred and seventeen letters, one hundred and fifty-six words, forty-six commas, one dot, six dashes, one hundred and forty-nine spaces, eighty-two quotes, two words "This", five words "and", two words "commas", one word "dash", two words "dashes", two words "dot", one word "eight", two words "eighteen", two words "eighty", one word "eleven", one word "fifteen", two words "fifty", two words "five", three words "forty", four words "four", one word "fourteen", two words "has", four words "hundred", two words "letters", two words "nine", one word "nineteen", one word "ninety", eighteen words "one", two words "quotes", two words "sentence", two words "seven", two words "seventeen", one word "seventy", four words "six", one word "sixteen", one word "sixty", two words "spaces", one word "ten", two words "thirteen", two words "thirty", three words "three", one word "twelve", two words "twenty", twenty-one words "two", thirteen words "word" and thirty-one words "words".
Now, how to build that one? Amazingly, the following very simple approach works. Start with some string. Build a sentence that describes it. Now build a sentence that describes the previous sentence. And so on, until at one point you find that the sentences stop changing. It's true that this can never happen - but it turns out that trying out several initial strings is enough to find one that leads to a solution. It's true that the solution will be excessively long (e.g., all [one word "smth"] clauses look really unnecessary, don't they?), but who cares?
Here's the code:
http://77.41.63.3/blog/self-referential/SelfReferentialSentence.htmlhttp://77.41.63.3/blog/self-referential/NumberSpelling.html