Author |
Topic: factorials and powers (Read 675 times) |
|
Christine
Full Member
Posts: 159
|
|
factorials and powers
« on: Mar 4th, 2015, 5:40pm » |
Quote Modify
|
Is there a formula to determine the number of powers of n between n! and (n+1)! ?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: factorials and powers
« Reply #1 on: Mar 4th, 2015, 10:51pm » |
Quote Modify
|
I think there's practically only ever one power of n between n! and (n+1)! For any number between n! and (n+1)! multiplying or dividing by n usually takes it out of that range. To find out which power of n, you can use Stirling's approximation for factorials: ln(n!) ~ n*ln(n) - n + (1/2) ln(2n) Divide by ln(n), round up, and that power of n will almost certainly have to fall between n! and (n+1)!
|
« Last Edit: Mar 4th, 2015, 10:57pm by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Christine
Full Member
Posts: 159
|
|
Re: factorials and powers
« Reply #2 on: Mar 5th, 2015, 1:47pm » |
Quote Modify
|
on Mar 4th, 2015, 10:51pm, towr wrote:I think there's practically only ever one power of n between n! and (n+1)! For any number between n! and (n+1)! multiplying or dividing by n usually takes it out of that range. To find out which power of n, you can use Stirling's approximation for factorials: ln(n!) ~ n*ln(n) - n + (1/2) ln(2n) Divide by ln(n), round up, and that power of n will almost certainly have to fall between n! and (n+1)! |
| How do we know that there's only one power for n > 6?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: factorials and powers
« Reply #3 on: Mar 6th, 2015, 12:25am » |
Quote Modify
|
The a priori probability is about n/(n+1) that there's one, so there might conceivably be two, but it gets increasingly unlikely. ln(n!) = sumi=1..n ln(i), so Python Code: from math import log, ceil, floor log_nfac, log_n_1fac = 0, log(2) for n in range(2,1000000): log_nfac = log_n_1fac log_n_1fac += log(n+1) if floor(log_n_1fac/log(n)) != ceil(log_nfac/log(n)): print(n) |
| 2 and 5 are the only ones under 1000000 But that still doesn't prove anything. With a longer range, I find 28 850 323 and 71 517 600, but I'm not 100% confident in the precision at that point, though. (A lot of tiny rounding errors may have added up) [edit]Running the script with a higher-precision floating point library, I can at least scratch 28 850 323 from the list. Haven't gotten up to the other one yet, because high precision is slow. Though wolfram-alpha says it's also not one. [/edit]
|
« Last Edit: Mar 6th, 2015, 2:50am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: factorials and powers
« Reply #4 on: Mar 6th, 2015, 8:13am » |
Quote Modify
|
Is 2 between 2 and 6?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: factorials and powers
« Reply #5 on: Mar 6th, 2015, 8:44am » |
Quote Modify
|
on Mar 6th, 2015, 8:13am, rmsgrey wrote:If you use inclusive bounds, yes; 2 [2,6]. And also if you use half-open intervals that are open at the upper end; 2 [2,6). Also see: http://mathworld.wolfram.com/Between.html
|
« Last Edit: Mar 6th, 2015, 8:46am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
|