09 December 2007

I'm 4!

Today I turn 24.

Now, at some point a couple weeks ago I realized that 24 is 4 factorial. I will probably never be factorial-aged again; depending on who you believe, either one or two people in history have lived to be 120. (However, both of these people are fairly recent; bear in mind that the records that would allow one to verify this sort of thing didn't really start existing until sometime in the 19th century. Furthermore, lifespans are getting longer. So I'd be willing to bet that in my lifetime, more than two people will live to 120. However, I wouldn't bet on that person being me.)

Furthermore, 23 is a prime, and 25 is a square. Are there any numbers n such that n!-1 is prime and n!+1 is square?

Squares are rarer than primes (the density of squares around n is 1/(2√n), the density of primes around n is 1/(log n)), so it makes sense to start with squares. I found that 4!+1, 5!+1, 7!+1 were squares and then I stopped being able to do it in my head. That's enough to look it up in the Encyclopedia of Integer Sequences; where the numbers 25, 121, 5041 form an entire sequence; there are no more solutions to n!+1 = k2 with n < 4 × 109. Wikipedia tells me that this is called Brocard's problem, and that the presence of a finite number of solutions would follow from the abc conjecture.

Primes of the form n!-1 are a lot more common. 4!-1 = 23 is prime; 5! - 1 = 119 isn't; 7! - 1 = 5039 is. The sequence of integers n such that n!-1 is prime is sparse, but not sparse enough that I'd be willing to conjecture it's finite. And in fact, heuristically, the density of primes around n! is 1/(log n!), but log n! is around n log n, so the density of primes around n! is 1/(n log n); the sum
\sum_{n=a}^\infty {1 \over n \log n}

diverges by comparison with the integral
\int_a^\infty {1 \over x \log x} = \lim_{b \to \infty} (\log \log x) - (\log \log b)

and so I conjecture that the sequence is infinite. (Furthermore, this heuristic probably underestimates the number of primes in the sequence, because n! - 1 is automatically not divisible by any prime less than or equal to n.)

To answer the original question: there are almost certainly two solutions, (23, 24, 25) and (5039, 5040, 5041).

6 comments:

Anonymous said...

Mazal Tov !

Blake Stacey said...

Happy birthday.

.mau. said...

happy day-after-birthday! (boys, you aer young!)

Brent Yorgey said...

Happy birthday!

Mark Reid said...

Happy Birthday!

I've been a reader for a while now and really enjoy the frequency and quality of your posts. Keep up the great work!

michael said...

happy belated birthday.

i agree with mark.