I was wondering if there’s any positive integer power of 3 which is 1 less than a positive integer power of 2. The powers don’t have to be the same.
3[sup]n[/sup] = 2[sup]p[/sup] -1 where n,p are positive integers.
I wrote a program looking for any suitable n/p values, but I couldn’t find any. My program was limited to going up to 3[sup]647[/sup]
I noticed that it’s easy to find where 3[sup]n[/sup] = 2[sup]p[/sup] +1. An quick answer can be found with 3[sup]2[/sup] = 2[sup]3[/sup] + 1
My related question has to do with representing the 3[sup]n[/sup] value as a series of 2 to the power of some other numbers without coefficients. For example, I could write 3[sup]4[/sup]=81 as:
3[sup]4[/sup] = 81 = 2[sup]6[/sup] + 2[sup]4[/sup] + 2[sup]0[/sup] = 64 + 16 + 1
As a shorthand, I would say that 3[sup]4[/sup] could be represented by the sum of 2 to the powers of [6 4 0] and 3 terms are needed.
I also had my program print out the 2-to-the-power reduction for the various 3[sup]n[/sup]. One thing that surprised me was that there was limited number of terms required regardless of the value of n. To represent the numbers for 3[sup]n[/sup], where n are the integers from 20 to 647, the maximum number of terms needed was about 38. That surprises me because to represent a number like 2[sup]p[/sup] - 1 requires p terms. For example:
2[sup]5[/sup] - 1 = 31 = 2[sup]4[/sup] + 2[sup]3[/sup] + 2[sup]2[/sup] + 2[sup]1[/sup] + 2[sup]0[/sup] = 16 + 8 + 4 + 2 + 1
However, 3[sup]626[/sup] only requires 20 terms:
3[sup]626[/sup] = 2[sup]992[/sup] + 2[sup]989[/sup] + 2[sup]985[/sup] + 2[sup]984[/sup] + 2[sup]982[/sup] + 2[sup]980[/sup] + 2[sup]978[/sup] + 2[sup]976[/sup] + 2[sup]974[/sup] + 2[sup]968[/sup] + 2[sup]966[/sup] + 2[sup]959[/sup] + 2[sup]957[/sup] + 2[sup]956[/sup] + 2[sup]953[/sup] + 2[sup]949[/sup] + 2[sup]946[/sup] + 2[sup]945[/sup] + 2[sup]942[/sup] + 2[sup]0[/sup]
So my related question is this: Is there a maximum number of 2-to-the-power-of terms which can represent any 3[sup]p[/sup] number where, p is an integer from 1->infinity?