Backing into a problem

asked 2012-03-22 09:36:04 -0500

Shirley99 gravatar image

updated 2012-03-22 09:40:21 -0500

Is it possible to back your way into a problem?


I want to supply an integer and then produce an equation for that.

694 = 26^2 + 4^2 + 2

I would like to reduce the equation size to the most efficient possible.

edit retag flag offensive close merge delete



I think you would need to make the problem much more specific before it could become tractable. What kinds of ingredients and operations are allowed on the right side? How do you measure efficiency? And even once you specify this, unless your rules are pretty restrictive, I'm afraid that it's the kind of problem for which there won't be a neat, clean answer. Sorry.

jdc gravatar imagejdc ( 2012-03-22 09:53:23 -0500 )edit

On the right side only integer math(powers, addition, subtraction). Efficiency is the fewest number of characters(operations) in the equation. 2^2+2^2+2^2+2^2 is not as efficient as 4^2

Shirley99 gravatar imageShirley99 ( 2012-03-22 10:14:35 -0500 )edit

`n=n` looks pretty efficient to me.

John Palmieri gravatar imageJohn Palmieri ( 2012-03-22 13:44:17 -0500 )edit

I will need to produce an equation for a super large integer (1000+), so n=n is not so efficient.

Shirley99 gravatar imageShirley99 ( 2012-03-23 10:38:26 -0500 )edit

So give us an example of exactly what you want to do, so we have some idea what "efficient" means. Or perhaps define "efficient" in this context. Why is `1025=1025` any less efficient than `1025=2^10 + 1`?

John Palmieri gravatar imageJohn Palmieri ( 2012-03-23 15:18:30 -0500 )edit