Discussion:
Palindrome numbers
(too old to reply)
Keith F. Lynch
2013-12-03 04:06:43 UTC
Permalink
Prove that any number that's a palindrome in both binary and ternary
will have an odd number of digits in both bases.

For instance 100010001 in base 3 equals 1100111110011 in base 2.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
Barry Schwarz
2013-12-03 06:03:52 UTC
Permalink
On Tue, 3 Dec 2013 04:06:43 +0000 (UTC), "Keith F. Lynch"
Post by Keith F. Lynch
Prove that any number that's a palindrome in both binary and ternary
will have an odd number of digits in both bases.
For instance 100010001 in base 3 equals 1100111110011 in base 2.
010 base 3 equals 11 base 2?
--
Remove del for email
Keith F. Lynch
2013-12-04 01:50:39 UTC
Permalink
Post by Barry Schwarz
Post by Keith F. Lynch
Prove that any number that's a palindrome in both binary and
ternary will have an odd number of digits in both bases.
For instance 100010001 in base 3 equals 1100111110011 in base 2.
010 base 3 equals 11 base 2?
Leading zeros aren't allowed. This year is 2013, not 02013.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
John Jones
2013-12-04 16:03:40 UTC
Permalink
On Tue, 3 Dec 2013 04:06:43 +0000 (UTC), "Keith F. Lynch"
<***@KeithLynch.net> wrote in article <l7jlcj$gol$1
@reader1.panix.com>...
Post by Keith F. Lynch
Prove that any number that's a palindrome in both binary and ternary
will have an odd number of digits in both bases.
For instance 100010001 in base 3 equals 1100111110011 in base 2.
Note that since leading zeroes are not permitted the last digit of a
palindrome cannot be zero. In particular a binary palindrome (BP) can
only represent an odd number, and a tertiary palindrome (TP) cannot
represent a multiple of 3.

Suppose a TP has an even number of digits. Then its modulus mod 2 is the
sum of those digits mod 2 (similar to mod 9 for normal decimals). But
equal digits pair up mirror-like by definition of a palindrome, and so
must sum to 0 mod 2. But no BP can be an even number. And therefore no
even length TP can equal any BP. So we must have a TP of odd length.

Suppose we have an even length BP. Consider the value of the BP mod 3.
To calculate this we paint the digits alternately black and white and
then subtract the sum of the white digits from the sum of the black, mod
3 (similarly as forming mod 11 for normal decimals).

Since the BP has even length the middle two digits are equal in value
and opposite in colour, and therefore cancel out in that calculation.
But the outer two digits to those are equal in value but opposite in
colour, so they cancel. And by continuing this process we deduce that
the BP is 0 mod 3. But no TP is divisible by 3, so no even-length BP
cannot equal any TP. So we must have a BP of odd length.

I think that proves it.
HTH
JJ
John Jones
2013-12-05 11:13:04 UTC
Permalink
On Wed, 4 Dec 2013 16:03:40 -0000, "John Jones" <***@hotamil.com>
wrote in article <***@news.eternal-
september.org>...
Post by Barry Schwarz
On Tue, 3 Dec 2013 04:06:43 +0000 (UTC), "Keith F. Lynch"
@reader1.panix.com>...
Further to which, a computer search upto length 31 found only three
examples, representing the decimal numbers 6643 (OP's example), 1422773,
and 5415589.

I imagine there are more, but I cant think of a simple search strategy
which isnt O(2^n), and the mathematics reminds me of some formulae I was
toying with (or more accurately were toying with me) when examining the
collatz conjecture.

HTH
JJ
Keith F. Lynch
2013-12-07 02:19:13 UTC
Permalink
Post by John Jones
Further to which, a computer search upto length 31 found only three
examples, representing the decimal numbers 6643 (OP's example),
1422773, and 5415589.
I imagine there are more,
Seven are known, counting the trivial solution which you missed.
See http://oeis.org/A060792
Post by John Jones
but I cant think of a simple search strategy which isnt O(2^n), ...
Are you sure the exponent isn't n/2? You only have to loop over the
right-hand side of the number.

Several optimizations are possible, including only searching ranges of
numbers which have odd lengths in both binary and ternary. I wrote
a C program to find them. It loops over the right hand sides of the
ternary numbers. The left side is of course a mirror image of the
right side, the middle digit is always 1, and I skip those ranges
which would map into an even-length binary number. I heavily
optimized the ternary-to-binary base-conversion code, since that's
what's run the most. And I don't even bother converting it into
decimal unless it's a solution.

I ran it on my ISP, Panix. It takes less than a second to find the
first five of the seven known solutions.

1 1 1
6643 100010001 1100111110011
1422773 2200021200022 101011011010110110101
5415589 101012010210101 10100101010001010100101
90396755477 22122022220102222022122 1010100001100000100010000011000010101

I ran it on my dial-up shell ISP because I usually use a terminal, not
a computer, at home. I later ran it on another computer, which was
even faster. It found the sixth solution after a few hours, but
hadn't found the seventh after more than a week.

It's an open question whether there are infinitely many solutions.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
a***@verizon.net
2013-12-18 04:29:08 UTC
Permalink
This post might be inappropriate. Click to display it.
Keith F. Lynch
2013-12-20 03:35:46 UTC
Permalink
Post by a***@verizon.net
2004595370006815987563563
Challenged, not dared. I thought I'd find it with clever programming
and a slow computer before you'd find it with simpler programming and
a fast computer.

I didn't realize that you had read my posts explaining how I'd speed
up the search. Nor did I realize that life would intervene, and I
wouldn't have a chance to even start writing the program for several
days.

However, I have some new ideas on how to speed up the search even
more. You found the 8th dual binary-ternary palindrome, but I think
I'll find the 9th, even though my computers are lot older and slower
than yours.
Post by a***@verizon.net
The above number was, reluctantly, confirmed by Keith so I'm fairly
sure it's a solution.
"Reluctantly"? I don't spend all my time online, unlike some people.
Also, it took me time to confirm it. After I got your email, I
quickly wrote a base conversion program that will work on numbers of
*any* length, rather than being limited to my machine's word size.

2: 110101000011111010101010100101111011110111011110111101001010101010111110000101011
3: 221010112100202002120002212200021200202001211010122

And while I'm at it,

4: 12220133111110233132323313221111113300223
5: 32102202104224200013133120304013223
6: 13022330515021132403133213433455
7: 42335264631355134314453431502
8: 650372524573673675125276053
9: 27115322076085607622054118
10: 2004595370006815987563563
11: 226978108866737944128AA5
12: 376A681B84083816479B88B
13: 81628CAA5080999952070B
14: 19D5D13A7B59A584D9B839
15: 6065C5B980B41BE6695C8
16: 1A87D552F7BBDE9557C2B
17: 8693G29C68E42CB3923G
18: 2EH0GH751B467B00629H
19: 104EE4616ED4017HG43E
20: 7CIF7I6A24B4JG258I3
21: 33F58D8E80EJD070HE2
22: 185EJJ52KFFIF089855
23: E4K2GJ372F7I20793B
24: 6LAEJLNLK81FAHKN4B
25: 3B2AB4CM01GI7341HD
26: 1JP4502L17D1P91I0B
27: P3E9K2F2NI7IK1M3H
28: E16J3QRQ9O6HPRJFN
29: 808NK3HD8OCIB9296
30: 4JL39PB49D6GI6NSN
31: 2ND8FQGIN1227F3JA
32: 1L1ULABRRNNKLAV1B
33: 10ELFD1DSNJ0JJFT5
34: LCLUSEOWPM8ASQ1X
35: DT8WCK2S00ECFAJN
36: 92FIVUD9G39K9RMZ
Post by a***@verizon.net
The code is pretty messy as I had been trying a number of different
things. it requires the GMP library and assumes a modern 64 bit
programming environment.
Mine, when I get it done, will work even on an eight-bit machine, as I
store one digit per array element.
Post by a***@verizon.net
The code is embarrassingly parallel so a much larger machine could
search more space faster, ...
My approach is to shrink the search space.

Is your number, 2004595370006815987563563, prime? It's not divisible
by any small divisor. None of the other known solutions are prime.
There appears to be no pattern to the divisibility, except that none
are divisible by 2 or 3.

Last night 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 64^N-1 is a palindrome in bases 2, 4,
and 8 for all N.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
Michael F. Stemper
2013-12-20 15:49:00 UTC
Permalink
Post by Keith F. Lynch
Post by a***@verizon.net
2004595370006815987563563
Challenged, not dared. I thought I'd find it with clever programming
and a slow computer before you'd find it with simpler programming and
a fast computer.
I didn't realize that you had read my posts explaining how I'd speed
up the search. Nor did I realize that life would intervene, and I
wouldn't have a chance to even start writing the program for several
days.
However, I have some new ideas on how to speed up the search even
more. You found the 8th dual binary-ternary palindrome, but I think
I'll find the 9th, even though my computers are lot older and slower
than yours.
Post by a***@verizon.net
The above number was, reluctantly, confirmed by Keith so I'm fairly
sure it's a solution.
"Reluctantly"? I don't spend all my time online, unlike some people.
Also, it took me time to confirm it. After I got your email, I
quickly wrote a base conversion program that will work on numbers of
*any* length, rather than being limited to my machine's word size.
2: 110101000011111010101010100101111011110111011110111101001010101010111110000101011
3: 221010112100202002120002212200021200202001211010122
And while I'm at it,
4: 12220133111110233132323313221111113300223
5: 32102202104224200013133120304013223
6: 13022330515021132403133213433455
7: 42335264631355134314453431502
8: 650372524573673675125276053
9: 27115322076085607622054118
10: 2004595370006815987563563
11: 226978108866737944128AA5
12: 376A681B84083816479B88B
13: 81628CAA5080999952070B
14: 19D5D13A7B59A584D9B839
15: 6065C5B980B41BE6695C8
16: 1A87D552F7BBDE9557C2B
17: 8693G29C68E42CB3923G
18: 2EH0GH751B467B00629H
19: 104EE4616ED4017HG43E
20: 7CIF7I6A24B4JG258I3
21: 33F58D8E80EJD070HE2
22: 185EJJ52KFFIF089855
23: E4K2GJ372F7I20793B
24: 6LAEJLNLK81FAHKN4B
25: 3B2AB4CM01GI7341HD
26: 1JP4502L17D1P91I0B
27: P3E9K2F2NI7IK1M3H
28: E16J3QRQ9O6HPRJFN
29: 808NK3HD8OCIB9296
30: 4JL39PB49D6GI6NSN
31: 2ND8FQGIN1227F3JA
32: 1L1ULABRRNNKLAV1B
33: 10ELFD1DSNJ0JJFT5
34: LCLUSEOWPM8ASQ1X
35: DT8WCK2S00ECFAJN
36: 92FIVUD9G39K9RMZ
Post by a***@verizon.net
The code is pretty messy as I had been trying a number of different
things. it requires the GMP library and assumes a modern 64 bit
programming environment.
Mine, when I get it done, will work even on an eight-bit machine, as I
store one digit per array element.
Post by a***@verizon.net
The code is embarrassingly parallel so a much larger machine could
search more space faster, ...
My approach is to shrink the search space.
Is your number, 2004595370006815987563563, prime?
Testing it with Fermat's Little Theorem shows it to be composite.
--
Michael F. Stemper
This post contains greater than 95% post-consumer bytes by weight.
Keith F. Lynch
2013-12-21 02:29:46 UTC
Permalink
Post by Michael F. Stemper
Post by Keith F. Lynch
Is your number, 2004595370006815987563563, prime?
Testing it with Fermat's Little Theorem shows it to be composite.
It turns out its smallest prime factor is 142955759. The other known
solutions are all divisible by one- or two-digit primes. There
doesn't seem to be any pattern, other than that of course no solution
is divisible by 2 or 3.

Heuristically, I'd expect that there are infinitely many prime
solutions, but that they're so large that we'll never find any
of them.

Speaking of large, I was mistaken when I said 64^N-1 was a palindrome
in bases 2, 4, and 8 for all N. I should have said 4096^N-1 is. And
in general 2^NA!-1 is a palindrome in bases 2^1 through 2^A for all N.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
Michael F. Stemper
2013-12-26 22:21:05 UTC
Permalink
Post by Keith F. Lynch
Post by Michael F. Stemper
Post by Keith F. Lynch
Is your number, 2004595370006815987563563, prime?
Testing it with Fermat's Little Theorem shows it to be composite.
It turns out its smallest prime factor is 142955759.
2004595370006815987563563 / 142955759 = 14022487684506757, which
appears to be prime -- again by Fermat's Little Theorem.
--
Michael F. Stemper
The name of the story is "A Sound of Thunder".
It was written by Ray Bradbury. You're welcome.
Keith F. Lynch
2013-12-28 01:36:52 UTC
Permalink
Post by Michael F. Stemper
Post by Keith F. Lynch
It turns out its smallest prime factor is 142955759.
2004595370006815987563563 / 142955759 = 14022487684506757, which
appears to be prime -- again by Fermat's Little Theorem.
There was no need for that test. Since its smallest prime factor is
142955759, and that's larger than its cube root, the remaining factor
must also be prime. (The remaining factor couldn't very well be
divisible only by primes larger than its square root.)
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
a***@verizon.net
2013-12-20 17:44:45 UTC
Permalink
Post by Keith F. Lynch
Post by a***@verizon.net
2004595370006815987563563
Challenged, not dared. I thought I'd find it with clever programming
and a slow computer before you'd find it with simpler programming and
a fast computer.
I didn't realize that you had read my posts explaining how I'd speed
up the search. Nor did I realize that life would intervene, and I
wouldn't have a chance to even start writing the program for several
days.
Hey, if it's on the internet, it's fair game. =P
Post by Keith F. Lynch
However, I have some new ideas on how to speed up the search even
more. You found the 8th dual binary-ternary palindrome, but I think
I'll find the 9th, even though my computers are lot older and slower
than yours.
Good luck with that, I've looked at 4 trillion of them (2^42)
Post by Keith F. Lynch
Post by a***@verizon.net
The above number was, reluctantly, confirmed by Keith so I'm fairly
sure it's a solution.
"Reluctantly"? I don't spend all my time online, unlike some people.
Also, it took me time to confirm it. After I got your email, I
quickly wrote a base conversion program that will work on numbers of
*any* length, rather than being limited to my machine's word size.
omfg! wow... It's almost as if I didn't have a library call for that, or that the call didn't have lots of cool optimizations and advanced algorithms (described in the manual).
Post by Keith F. Lynch
Post by a***@verizon.net
The code is pretty messy as I had been trying a number of different
things. it requires the GMP library and assumes a modern 64 bit
programming environment.
Mine, when I get it done, will work even on an eight-bit machine, as I
store one digit per array element.
Yes, processing one byte at a time is soo much faster than processing 8 or even 16 bytes concurrently using 64 bit general purpose registers and 128 bit vector registers...
Keith F. Lynch
2014-01-08 04:34:55 UTC
Permalink
Post by a***@verizon.net
Post by Keith F. Lynch
However, I have some new ideas on how to speed up the search even
more. You found the 8th dual binary-ternary palindrome, but I
think I'll find the 9th, even though my computers are lot older
and slower than yours.
Good luck with that, I've looked at 4 trillion of them (2^42)
I looked at a lot fewer numbers, but I looked at the *right* numbers.
Post by a***@verizon.net
Post by Keith F. Lynch
After I got your email, I quickly wrote a base conversion program
that will work on numbers of *any* length, rather than being
limited to my machine's word size.
omfg! wow... It's almost as if I didn't have a library call for
that, or that the call didn't have lots of cool optimizations and
advanced algorithms (described in the manual).
That's good, since it will allow you to confirm my discovery of the
ninth dual binary-ternary palindrome, 8022581057533823761829436662099.

Unless, of course, that's too many digits for your 64-bit machine to
handle.

That's
1100101010000100101101110000011011011111111011000011100001101111111101101100000111011010010000101010011
binary and
21000020210011222122220212010000100001021202222122211001202000012
ternary. 103 bits, 65 trits, 31 decimal digits.

It's more than four million times larger than your solution,
2004595370006815987563563, which is why it took me a few days to find
it on my slow computer. Just as importantly, I confirmed that there
are no smaller solutions other than those already known.
Post by a***@verizon.net
Yes, processing one byte at a time is soo much faster than
processing 8 or even 16 bytes concurrently using 64 bit general
purpose registers and 128 bit vector registers...
Apparently it is, at least if I'm the one writing the program.

Would you prefer to see the description of my program, to see if you
can code it? Or the code itself, to see if you can figure out how
it works?
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
a***@verizon.net
2014-01-08 16:52:26 UTC
Permalink
Post by Keith F. Lynch
Would you prefer to see the description of my program, to see if you
can code it? Or the code itself, to see if you can figure out how
it works?
The code... You are at roughly the square of where I was... =(
a***@verizon.net
2014-01-08 17:10:57 UTC
Permalink
Confirmed, It was literally ten times out from where my search was...

My code calls that area group 336010, I was looking at group 32810.
Keith F. Lynch
2014-01-09 00:41:48 UTC
Permalink
Post by a***@verizon.net
Post by Keith F. Lynch
Would you prefer to see the description of my program, to see if
you can code it? Or the code itself, to see if you can figure out
how it works?
The code...
Okay, I will email it to you, but only if you agree that any further
dual palindromes you find, I will get primary credit for. After all,
even without understanding the program you could just sit back and let
it generate palindromes for you. Or, with a little understanding, you
could modify it to find dual palindromes in other bases.

Are you sure you wouldn't rather have the explanation? Were you ever
able to make sense of the three-line program I sent you? (The code in
question is more like 300 lines.) As I said in an email last month:

Since you are eager to see my my code, here's something I wrote as
a joke last year. This is *NOT* my usual coding style. Indeed, I
deliberately put several serious errors in it, for instance I use
an uninitialized array. Nevertheless it works perfectly. Explain.

void main(){int j,k,l[1002];for(j=1776;j;j--){for(k=0;k<1001;k++){l[k+1]+=
10*(l[k]%j);l[k]/=j;}l[0]++;}for(j=0;j<1001;j++){printf("%d",l[j]);if(!j)
printf("%c",46);}printf("\n");}

This being an open newsgroup, everyone is welcome to chime in here.

(To clarify, the same restriction is on the explanation. If I email
it to you, I'll get primary credit for any dual palindromes you
subsequently find. You are of course free to keep searching without
the code or explanation, and take full credit for anything you find.)
Post by a***@verizon.net
You are at roughly the square of where I was... =(
No. The ratio between the logs of our numbers is about 1.27, so my
number is about equal to the 1.27 power of yours. Phrased another
way, it has about 27% more digits in any base. If it was the square
it would have about twice as many digits.

The ratio between our numbers is more than four million, but that's
not the record ratio between successive terms. Here's an ASCII graph
of all known solutions, with each place representing a power of four:

*-----*---**------*----------*-----*----*----------*

Here's the same thing, but with powers of nine:

*---*-**---*------*---*--*------*

As I mentioned before, I'm pretty sure the density is long-range-
uniform but short-range-random on such a log chart. And I'm certain
I haven't missed any solutions within this range.

But if you want to be impressed by the size of my number, a good
illustration, especially considering that this all started when you
accused my hardware, software, and skills of being obsolete, is that
my number is roughly equal to the number of atoms in a large dinosaur.
(Your number is roughly equal to the number of atoms in a small mouse.)

Here's the complete list of known solutions so far:

1
6643
1422773
5415589
90396755477
381920985378904469 Francois Boisson & Bruno Petazzoni, Jan 2006
1922624336133018996235 Francois Boisson & Bruno Petazzoni, May 2006
2004595370006815987563563 You, Dec 2013
8022581057533823761829436662099 Me, Jan 2014

With Fermat numbers, by contrast, each one is roughly the square of
the previous, i.e. has about twice as many digits in any base.
Indeed, a recursive definition of Fermat number is F(0) = 3;
F(N) = (F(N-1)-1)^2 + 1. Their log plot looks like:

**-*---*-------*---------------*-------------------------------*

With each number twice as far to the right as the previous. Their
log log plot is uniform.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
Keith F. Lynch
2013-12-07 01:48:33 UTC
Permalink
Post by John Jones
Note that since leading zeroes are not permitted the last digit of a
palindrome cannot be zero. In particular a binary palindrome (BP)
can only represent an odd number, and a tertiary palindrome (TP)
cannot represent a multiple of 3.
Suppose a TP has an even number of digits. Then its modulus mod
2 is the sum of those digits mod 2 (similar to mod 9 for normal
decimals). But equal digits pair up mirror-like by definition of a
palindrome, and so must sum to 0 mod 2. But no BP can be an even
number. And therefore no even length TP can equal any BP. So we
must have a TP of odd length.
Suppose we have an even length BP. Consider the value of the BP
mod 3. To calculate this we paint the digits alternately black and
white and then subtract the sum of the white digits from the sum of
the black, mod 3 (similarly as forming mod 11 for normal decimals).
Since the BP has even length the middle two digits are equal in
value and opposite in colour, and therefore cancel out in that
calculation. But the outer two digits to those are equal in value
but opposite in colour, so they cancel. And by continuing this
process we deduce that the BP is 0 mod 3. But no TP is divisible by
3, so no even-length BP cannot equal any TP. So we must have a BP
of odd length.
I think that proves it.
Correct. Well done. That's identical to my proof, except that I
would have phrased the rule for determining whether a number in
ternary is odd more simply: In any odd base, a number is odd iff it
has an odd number of odd digits. As such, a ternary palindrome can
only be odd if its length is odd and the middle digit is 1.

(In any even base, a number is odd iff its last digit is odd.)
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
a***@verizon.net
2013-12-20 21:30:24 UTC
Permalink
I've been working on how much CPU time I am going to have to waste on this crap.

What I've been doing is trying to work out a growth function based on the size of my counter variable... So here's a table of the number of ternary counter digits for each known number.

1 -> 0
2 -> 4
3 -> 6
4 -> 7
5 -> 11
6 -> 18
7 -> 22
8 -> 25

So the incremental growth function is:

2 -> 4
3 -> 2
4 -> 1
5 -> 4
6 -> 7
7 -> 4
8 -> 3

So we could expect the next hit to be somewhere between 3^26 < x < 3^33 with moderately high confidence and between 3^29 and 3^30 with some confidence (because the mode of the second table is 4).

3^26 -> 2^41 <<< my search is already within this range.
3^29 -> 2^45
3^30 -> 2^47
3^33 -> 2^52.3

My current rig is doing about 2^40 every day.
So:

2^45 -> 1 month.
2^47 -> 6 months.
2^52.3 -> 14 years.

So yeah, I really should go find something more productive to do with my life. =\

The problem is very amenable to distributed computing, just needs a little protocol driver to request blocks from a server that would organize the search around the most probable ranges and, if a hit is found, fill in all blocks before the hit and then start again with new ranges...
a***@verizon.net
2014-01-21 18:05:36 UTC
Permalink
I'm thinking of a number that's 119 bits long, 54 of which are 1 and, in decimal, begins with a 3. =P

I really like numbers beginning with 3 so I came up with one that has 125 bits, 57 of which are 1. =P
a***@verizon.net
2014-01-27 17:01:14 UTC
Permalink
Just so there's a public record, here are some recent numbers:

392629621582222667733213907054116073
32456836304775204439912231201966254787
428027336071597254024922793107218595973
1597863243206403857787246920544522912361

These were found on my computer with code written by myself but the key algorithmic insight came from Keith, he wanted this immense lookup table for modulos, since the beginning and end must be the same, if you can compute the modulus (which can be done with addition), then you can both narrow down your search space (using something akin to a hash table) and can thus spare you from having to convert and test a metric ass-ton of wrong numbers.

My code has looked at everything up from Keith's last number to 3^80 or so. I have separate threads looking at 3^82 -> 3^88 but my program hasn't outputted anything in days... If I don't see any output by tomorrow night then I'll begin to suspect that it has crashed somehow.
Keith F. Lynch
2014-01-30 00:41:29 UTC
Permalink
[ The subject is numbers which are palindromes when expressed in both
binary and standard ternary. ]
Just so there's a public record, here are some recent numbers: ...
These were found on my computer with code written by myself but the key
algorithmic insight came from Keith,
Thanks for the acknowledgement.
he wanted this immense lookup table for modulos, since the beginning
and end must be the same, if you can compute the modulus (which can
be done with addition), then you can both narrow down your search
space (using something akin to a hash table) and can thus spare you
from having to convert and test a metric ass-ton of wrong numbers.
That's part of my speedup. The other part is piecewise pre-computing
all the ternary-to-binary conversions, since you're going to be doing
trillions of them. You're not doing that?

Details on my algorithm can be found linked from the URL below.
My code has looked at everything up from Keith's last number to 3^80
or so.
It's just as important to know what isn't a solution as to know what
is. I haven't submitted any of your newly discovered numbers to
http://oeis.org/A060792, since they're not interested in random terms,
but in known consecutive terms. Are you saying you're sure you
haven't missed any below 3^80?

Here's a single-page summary of the results so far, showing each
solution, how many bits and trits it has, how many more bits and trits
it has than the previous solution, its remainder when divided by
various small numbers, and finally its smallest divisor:

(I hope everyone is viewing this with a fixed-width font).

modulo 1 1 1
n b t db dt 3 4 5 7 9 1 3 7 s

1 1 1 1 1 1 1 1 1 1 1 1
2 6643 13 9 12 8 1 3 3 0 1 A 0 D 7
3 1422773 21 13 8 4 2 1 3 2 8 0 1 9 11
4 5415589 23 15 2 2 1 1 4 4 1 3 A 1 19
5 90396755477 37 23 14 8 2 1 2 0 8 6 2 9 7
6 381920985378904469 59 37 22 14 2 1 4 1 5 3 4 4 19
7 1922624336133018996235 71 45 12 8 1 3 0 2 7 A 4 B 5
8 2004595370006815987563563 81 51 10 6 2 3 3 2 8 5 B G >
9 8022581057533823761829436662099 103 65 22 14 2 3 4 4 5 3 C G >
? 392629621582222667733213907054116073 119 75 16?10? 1 1 3 4 7 8 7 0 17
? 32456836304775204439912231201966254787 125 79 6? 4? 1 3 2 6 7 8 6 B 83
? 428027336071597254024922793107218595973 129 81 4? 2? 2 1 3 0 8 7 2 F 7
? 1597863243206403857787246920544522912361 131 83 2? 2? 1 1 1 1 1 6 9 2 29
? 30412638162199251273509758127730300026189 135 85 4? 2? 2 1 4 3 5 0 B 4 11

And here's a log chart showing their distribution by powers of 4 and of 9:

1-----1---11------1----------1-----1----1----------1-------1--1-11-1

1---1-11---1------1---1--1------1----1-1111

I don't know if there's any significance to the clustering near the
end. I have a heuristic proof that the distribution, in log space,
should be completely random but asymptotically uniform over the long
range, i.e. a graph of the logs of the ratios between successive terms
ought to form a nice bell curve.

Neither do I know whether there's any significance to the 9 remainder
being 1 or 8 most of the time.

Between the two of us, we've doubled the number of known solutions.

I think I've figured out why the density of numbers which are
palindromes when expressed in both binary and *balanced* ternary is
much higher even though there are exactly the same number of positive
odd N-trit balanced ternary palindromes as there are positive odd
N-trit standard ternary palindromes: The former are on average just
half the size, so they're hitting denser distributions of binary
palindromes. (Positive N-trit standard ternary numbers run from 3^N
to roughly 3^(N+1). Positive N-trit balanced ternary numbers run from
roughly (3^N)/2 to roughly 3^(N+1)/2.)
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
Loading...