Re: [math-fun] peculiar sequence
Bill Gosper <billgosper@gmail.com> wrote:
Despite my distaste for decimal digits, I noticed (while showing Mathematica to new user Miles) that 52! ends in twelve 0s both in decimal and hex. Equality happens ... with gradually declining frequency:
Tomas Rokicki <rokicki@gmail.com> wrote:
Maybe it's finite, maybe it's not. Asymptotically of course the count of zeros in both decimal and hex in n! are n/4; surprising that.
I could only get to 10^11 quickly: ....
Overuse of Mathematica rots the brain. If you want an exact count, the number of 0-digits at the end of n! is sum(floor(n/5^j)) for decimal, and floor(sum(floor(n/2^j))/4) for hexadecimal. In both cases j ranges over all positive integers. Using those formulas, it should be easy to get way past 10^11. "How many zero-digits does one thousand factorial end with" is a fun problem to give to people to solve in their head.
On 03/09/2016 19:25, Keith F. Lynch wrote: [...]
Tomas Rokicki <rokicki@gmail.com> wrote: [...]
I could only get to 10^11 quickly: ....
Overuse of Mathematica rots the brain.
If you want an exact count, the number of 0-digits at the end of n! is sum(floor(n/5^j)) for decimal, and floor(sum(floor(n/2^j))/4) for hexadecimal. In both cases j ranges over all positive integers. Using those formulas, it should be easy to get way past 10^11.
It's nice and quick and easy to compute the number of zeros on the end of a single factorial in base 10 or 16, yes. But the challenge is to count how many times equality occurs, and if you want e.g. to go from Tomas's 10^11 to 10^12 then you have 10^12 numbers to check, doing a bunch of divisions for each. If you have a way of doing that *quickly* then do by all means share it with us. Otherwise, I think accusing other people of rotted brains is premature. (In particular, if you are suggesting that T.R. got his counts by *actually computing the factorials* then I suggest you reconsider how plausible that is.) -- g
The number of zeroes at the end of n! is equal in bases 10 and 16 iff 0 <= sum of base-5 digits of n - sum of base-2 digits of n <= 3.
David Wilson's assertion that The number of zeroes at the end of n! is equal in bases 10 and 16 iff
0 <= sum of base-5 digits of n - sum of base-2 digits of n <= 3.
has a very sweet proof! I admit I started looking for a counterexample before a proof, but I should have had more faith. I'm omitting the proof because I don't want to spare anyone else the joy of discovery. -- -- http://cube20.org/ -- [ <http://golly.sf.net/>Golly link suppressed; ask me why] --
For large n, the sum of the base-5 digits of n hovers around 2*log_5(n) ~= 1.242 log(n), but this is not an asymptotic relationship. Similarly, the sum of the base-2 digits of n hovers around 0.5*log_2(n) = 0.721 log(n). This means that as n grows larger, the sum of the base-5 digits will tend grow faster than the sum of the base-2 digits. This means that the proportion of n satisfying [1] 0 <= sum of base-5 digits of n - sum of base-2 digits of n <= 3 should tend to decrease n grows larger. The numbers satisfying [1] are precisely the n such that n! has the same number of trailing 0's in bases 10 and 16. Hence we should expect these numbers to thin out as n increases, I strongly suspect the limit density is 0 over Z. On the other hand, there are arbitrarily large numbers n (specifically, the powers of 5), whose base-5 digit sum is smaller than the base-2 digit sum. This would indicate that there are arbitrarily large numbers n satisfying [1], i.e., an infinitude of such n. Let S(a, b) = {n | n! has the same number of trailing zeroes in bases a and b}. I suspect that S(a, b) is infinite iff A090624(a) = A090624(b). In some cases, S(a, b) = N, e.g. a = 5, b = 10. -----Original Message----- From: math-fun [mailto:math-fun-bounces@mailman.xmission.com] On Behalf Of David Wilson Sent: Saturday, September 03, 2016 6:21 PM To: 'math-fun' Subject: Re: [math-fun] peculiar sequence The number of zeroes at the end of n! is equal in bases 10 and 16 iff 0 <= sum of base-5 digits of n - sum of base-2 digits of n <= 3. _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (4)
-
David Wilson -
Gareth McCaughan -
Keith F. Lynch -
Tomas Rokicki