- #1

- 85

- 5

Is there a way to formulate the solution of minimization of:

abs(n-2^x*3^y)

Over integers x and y for any given integer n?

A numeric example that I found by trial and error is:

|6859-2^8*3^3|=53

Thanks in advance.

- I
- Thread starter a1call
- Start date

- #1

- 85

- 5

Is there a way to formulate the solution of minimization of:

abs(n-2^x*3^y)

Over integers x and y for any given integer n?

A numeric example that I found by trial and error is:

|6859-2^8*3^3|=53

Thanks in advance.

- #2

Mark44

Mentor

- 34,311

- 5,949

That's hardly a minimum value. If n = x = y = 1, the result is |-5| = 5

Is there a way to formulate the solution of minimization of:

abs(n-2^x*3^y)

Over integers x and y for any given integer n?

A numeric example that I found by trial and error is:

|6859-2^8*3^3|=53

Thanks in advance.

If n = 6 and x = y = 1, the result is 0, which would be minimum value for the parameter n = 6.

Have you studied calculus? In particular multivariate calculus? There are a couple of techniques that can be used to function the minimum or maximum of a function of two variables. There is also the technique of Lagrange multipliers.

- #3

- 85

- 5

Hi Mark44,

n is not meant to be a variable. It is a known integer value and the problem is to solve for integer variables x and y such that the result has smallest integer value. So for my numeric example n can only be 6859. x and y can be any integers. the minimization solution is x=8 and y= 3, because no other**integer** values of x and/or y will result in a number less than 53.

As far as I know calculus does offer solutions over the rational field but not over the integer field.

Would the Lagrange multipliers offer a general solution for this?

Thank you for the reply.

n is not meant to be a variable. It is a known integer value and the problem is to solve for integer variables x and y such that the result has smallest integer value. So for my numeric example n can only be 6859. x and y can be any integers. the minimization solution is x=8 and y= 3, because no other

As far as I know calculus does offer solutions over the rational field but not over the integer field.

Would the Lagrange multipliers offer a general solution for this?

Thank you for the reply.

Last edited:

- #4

- 85

- 5

- #5

mfb

Mentor

- 34,982

- 11,171

Minimizing abs(2^x-3^y) apart from the case |8-9|=1 is still an open problem. Your problem doesn't look easier.

log(n)=x*log(2)+y*log(3) and some approximation techniques could help to reduce the number of cases to test.

- #6

- 85

- 5

Thank you for the reply mfb.

The log formula is very interesting.

The log formula is very interesting.

- Last Post

- Replies
- 5

- Views
- 2K

- Replies
- 2

- Views
- 1K

- Last Post

- Replies
- 5

- Views
- 725

- Last Post

- Replies
- 16

- Views
- 2K

- Replies
- 4

- Views
- 4K

- Last Post

- Replies
- 1

- Views
- 1K

- Last Post

- Replies
- 4

- Views
- 2K

- Last Post

- Replies
- 2

- Views
- 3K

- Last Post

- Replies
- 3

- Views
- 2K

- Last Post

- Replies
- 5

- Views
- 3K