Message Boards Message Boards

0
|
2743 Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

[?] Express a number in its most compact sum of powers?

Posted 5 years ago

Given a number n, what is the best approach to find the most compact representation for n in terms of sums of powers, such that the bases can't surpass a given value?

Representation

The betas are the base and are limited in range (they are non-negative and can't surpass a given value, say, for instance, 2^32). Amongst all possible representations, how could we find the one(s) that have the less non-zero betas possible?

As an example of an instance of the problem, suppose n = 558545864083284009.

Amongst all possible such representations of this number, there is at least one that requires only two betas:

beta1 = 2, beta21 = 7, such that 2^1 + 7^21 = 558545864083284009.

Is it possible to solve the problem? I mean... Of course it's possible, but is there any approach better than brute-forcing? Thanks!

Davi,

You can use NMinimize:

NMinimize[{c, a1^b + a2^c == 558545864083284009, a1 > 0, a2 > 0, 
  b > 0, c > 0}, {a1, b, a2, c} \[Element] Integers, 
 WorkingPrecision -> 50]

To get

{1.0000000000000000000000000000000000000000000000000,{a1->7,b->21,a2->2,c->1}}

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract