Minimize |n-2^x*3^y| over the integer

  • I
  • Thread starter a1call
  • Start date
  • #1
85
5
Hi,
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.
 

Answers and Replies

  • #2
34,311
5,949
Hi,
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.
That's hardly a minimum value. If n = x = y = 1, the result is |-5| = 5
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.
 
Last edited:
  • #4
85
5
I don't expect there to be a known solution for this. I am just looking for expert-confirmation or authoritative-reference on the subject.
 
  • #5
34,982
11,171
Positive integers? Otherwise there is no minimum.

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.
 

Related Threads on Minimize |n-2^x*3^y| over the integer

  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
5
Views
725
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
Top