The decimal expansion of pi never repeats. It's an irrational number (which means it cannot be expressed as a fraction).

You may be getting it confused with 22/7, which is a common approximation to pi. But it's not precise. The first digits to pi are actually 3.14159265358979323... (which is as far as I remember it without looking it up!)

Since it is irrational, it goes on forever and there is no pattern. That means that you can pick ANY pattern, of ANY length, and EVENTUALLY you will find it. this site has the first 100k digits, and 2013 appears no less than eleven times. If you keep expanding the value out, the number of times 2013 appears will approach infinity.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

fred rosenberger wrote:Since it is irrational, it goes on forever and there is no pattern. That means that you can pick ANY pattern, of ANY length, and EVENTUALLY you will find it.

That may be true about Pi, but it's seriously non-trivial to prove, and I'm not sure it has actually been proved yet. But I don't think it would be hard to find a counter-example that disproves it in general.

Take this simple example: define PIE as the number with the same decimal expansion as PI, except that every time you find the sequence '2013' in it, you remove it (recursively, if necessary, so you would remove '20201313' completely). Now I'm as close to certain as I can be without having a cast-iron proof that PIE would be irrational. But it also doesn't contain the sequence 2013 anywhere.

To pick another counter-example, there exist irrational numbers that are clearly not random. They can have a pattern, as long as it isn't a repeating pattern. For example:

0.101001000100001000001... (where the number of 0s between 1s increases by one each time)

Matthew Brown wrote:To pick another counter-example, there exist irrational numbers that are clearly not random. They can have a pattern, as long as it isn't a repeating pattern. For example:

0.101001000100001000001... (where the number of 0s between 1s increases by one each time)

But Pi isn't like that. Probably

well...can you prove that 0.101001000100001000001... is irrational, first of all. I'm not saying it is or isn't...I'm just saying that is not immediately obvious to me. Pi being irrational is also not immediately obvious to me, but it HAS been proved.

And how can you COMPLETELY remove something from an infinite series of digits? And until you CAN prove that your number PIE is irrational, your example is moot. "I have a number that may or may not be irrational, but I'm going to use it to prove that an irrational number doesn't contain 2013".

;-)

I do, however, take your point. Perhaps I was a little over-zealous in my statement.

As I understand it, yes, probably. Pi may well be "normal", which means no finite sequence of numbers appears more often than others of the same length. Which is an even stronger condition than saying all sequences appear an infinite number of times. But it's been very resistant to proving these things for certain.

fred rosenberger wrote:
well...can you prove that 0.101001000100001000001... is irrational, first of all. I'm not saying it is or isn't...I'm just saying that is not immediately obvious to me. Pi being irrational is also not immediately obvious to me, but it HAS been proved.

Actually, that's relatively easy. All rational numbers terminate in a repeated sequence of a finite number of digits*. That number doesn't. Therefore it's irrational.

* Proof: just go through the algorithm for calculating the decimal expansion of p/q where p and q are integers (multiply p by 10, divide by q, take the remainder and continue). As soon as you hit a number you've had before the sequence will repeat from that point. And since you're working modulo q, the number of possible remainders is bounded by q. p/q must therefore have a repeating terminal sequence of no more than q digits.