Re: [math-fun] Dual palindromes
Neil Sloane <njasloane@gmail.com> wrote:
In view of the contradictory arguments we've seen, would someone PLEASE add the definitive answer to A060792 ? "The following heuristic argument shows that there are almost certainly onlyfinitely/infinitely many terms in this sequence ..."
This is far from definitive, but since I don't think anyone has made this argument yet, I will rush in where professional mathematicians fear to tread. There's no question that in both binary and ternary the odds of a number around N being a palindrome in that base is some constant times N^-(1/2). So if there's no correlation between the odds of a number being a palindrome in binary and the odds of the same number being a palindrome in ternary, the odds of a number around N being a palindrome in both bases should be some constant times N^-1. And the integral of that is gamma plus the same constant times log N. So there should be a roughly equal number of dual palindromes per factor of 2 (or of 3, or of 10, or of e). What little data there is isn't obviously incompatible with this. Here's how many solutions there are per factor of ten (e.g. there are two seven-decimal-digit solutions): 1--1--2---1------1---1--1-----1 More natural is charting it per factor of four: 1-----1---11------1----------1-----1----1----------1 or of nine: 1---1-11---1------1---1--1------1 These charts include two newly discovered solutions, 2004595370006815987563563, found in December by my friend Alan Grimes, in competition with me to find the next solution, and 8022581057533823761829436662099 found by me in January to redeem myself. I also confirmed there are no smaller solutions except those already known. These should be added to A060792 with appropriate credit given. (If anyone is interested in my algorithm for finding such numbers, please tell me, and I'll describe it here.) So, what are these constants I mentioned? Since the leading digit can't be zero, neither can the trailing digit. So a number can only be a ternary palindrome if it's not divisible by 3, and can only be a binary palindrome if it's not divisible by 2. A ternary palindrome can only be odd if it has an odd length and the middle digit is 1, in which case it's always odd. A binary palindrome can't be not divisible by 3 unless it's of odd length, in which case it has the expected 2/3 odds of not being divisible by 3. So we only need to look at odd-length palindromes. (Apparently Giovanni Resta (owner of the recently discussed Numbers Aplenty website) didn't realize this, as he said, in A060792 last year, "a(8) (if it exists) is greater than 2^75." Had he realized this, he would have known that there can't be a solution between 2^75 and 2^76, and would have used the latter number.) As far as I can tell, other than these constraints, the correlation is completely "random," in the same sense as the digit of pi (apparently) are. The number of T-trit ternary palindromes (T being odd) which have a middle digit of 1 is exactly (2/3) 3^((T-1)/2). (The 2/3 is because the first trit can't be zero.) The total number of T-trit numbers with 1 as a middle digit is (2/3) 3^T. So the proportion of T-trit numbers that are ternary palindromes with a middle digit of 1 is 3^((T-1)/2) / 3^T = 3^-((T+1)/2). The number of B-bit binary palindromes (B being odd) is 2^((B-1)/2). The number of B-bit numbers is 2^(B-1). So the proportion of B-bit numbers that are binary palindromes is 2^((B-1)/2) / 2^(B-1) = 2^((1-B)/2). So, given that you randomly choose a number which is B bits long when represented in binary and T trits long when represented in ternary, with B and T both being odd, the odds that it's a dual binary-ternary palindrome should be about 3^-((T+1)/2) * 2^((1-B)/2). Integrating would be hairy, since neither B nor T is a continuous function of N. B is log2(N) rounded up to the next integer, and T is log3(N) rounded up to the next integer. And you only integrate where B and T are both odd. I did a numerical integration, starting with N=1 and repeatedly incrementing N by a factor of 1.001 until I reached the highest known solution, which is 103 bits and 65 trits long. I get 9.9, which is in excellent agreement with the actual number of solutions in that range, which is 9. I continued the integration to N = 2^1000, at which point the predicted number of solutions is 92.4. So it would seem that the desired constant is about 0.134, meaning that the geometric mean of the ratio between consecutive terms is about 1700. (If the constant was 1, the geometric mean of the ratio would be e.) So my heuristic argument is that there ought to be infinitely many solutions, and on average each solution ought to be e^7.5 (about 1700) times larger than the previous solution. Of course that's a long term average; they're distributed very irregularly. If my constant is wrong, that changes the numbers in the previous paragraph, but doesn't otherwise alter my conclusion. I think the only way there could only be finitely many solutions is if there's some other constraint which grows with size. For instance if ternary palindromes became increasingly likely to be divisible by 7, and binary palindromes became increasingly likely to *not* be divisible by 7. I have looked at divisibility, and, other than divisibility by 2 and 3, both binary and ternary palindromes appear to have the expected proportion of each remainder of each prime divisor. Of course I haven't checked all sizes or all primes, but it would be very strange if they started acting up only at large values. This leads me to the question of whether there are infinitely many dual binary-ternary palindromes that are prime. None of the nine known are, but I would predict that infinitely many are, though very likely nobody will ever find one, as the first one would likely be utterly immense. I explored dual palindromes in other pairs of bases. Here are how many non-trivial dual palindromes there below 100 trillion (10^14) in each pair of bases 2 though 16. (I define a trivial dual palindrome as one that's a single digit in one or both bases. For instance 1 though 7 are all trivial dual octal-decimal palindromes.) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 4 4 6142 12 5 13 16 18 6 40 36 31 19 7 23 33 25 36 19 8 33276 16 3080 28 32 25 9 30 9716 32 18 25 40 29 10 42 38 35 30 66 37 39 39 11 25 32 29 51 19 37 31 36 51 12 29 34 41 35 36 35 41 31 26 76 13 26 34 31 31 41 22 44 46 47 37 94 14 58 32 43 35 27 30 46 45 31 46 35 109 15 25 54 28 44 43 60 25 34 41 43 40 44 133 16 6778 22 9210 38 43 27 308 36 46 42 41 40 44 138 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Note that: * There are dual palindromes for every pair of bases * Binary-ternary dual palindromes are by far the rarest * Two bases having a factor in common seems to have little or no effect unless they're powers of the same number The 72252 non-trivial dual palindromes include 541 triple palindromes, 38 quadruples, and one quintuple: 11111111 (2), 3333 (4), 313 (9), 212 (11), FF (16). A triple that contains a base 10 number is 1221010220101221 (3), 24043234042 (5), 27711772 (10). I suspect that for every pair of bases, there are infinitely many dual palindromes. And that for nearly every triple of bases, there are finitely many triple palindromes, usually a very small number. There are special cases where there are infinitely many triple palindromes. For instance 4096^N - 1 is a palindrome in bases 2, 4, and 8 for all N. And 2^(A(N!)) - 1 is an N-multiple palindrome in bases 2^1 through 2^N for all A.
participants (1)
-
Keith F. Lynch