1. ## Algorithm help

Hello Math Master..

i need ur help if you have free time..
i have a question. is it possible to do this.

question ->

1+2+3+4 = 10
from the result (10), i want to get all the plus value(1,2,3,4).
is it possible?

thanks for your time and help... appreciate it...

2. Originally Posted by oneman
Hello Math Master..

i need ur help if you have free time..
i have a question. is it possible to do this.

question ->

1+2+3+4 = 10
from the result (10), i want to get all the plus value(1,2,3,4).
is it possible?

thanks for your time and help... appreciate it...
It's not possible because you question is incomprehensible, consider rewording it.

CB

3. Originally Posted by CaptainBlack
It's not possible because you question is incomprehensible, consider rewording it.

CB
so sorry for the trouble,

again

when u plus all the integer for example 1,2,3,4 the result should be 10.
now i want to get all the integer from the result only.
meaning when i type 10 and type total digit of 4, i should get 1,2,3,4.
it can also be 2,3,5 or 6,4 or 7,2,1 as long it is not a repeating number and depending on total digit.

hope this is clear enough.

Thanks

OM

4. Are you programming this? If so you would need a list of valid values.
beacause you could also have
-90+100=10.
-490+500=10.

5. sorry for not mention it.. it must be positive value.. i think there is a solution.. but i dont know..

6. No, that's still not clear. Do you mean, "Given a positive integer N, and another positive integer i, find i (distinct? consecutive?) integers whose some is N"? If so, for many values of N and i, there will be NO such integers while for others there will be many answers.

7. ## n(n+1) / 2 = 10 or have I missed the point ?

surely this is just a series: n(n+1) / 2 = 10
therefore n^2 + n - 20 = 0
solve this quadratic for n ( 4, -5 )
Obviously 4 is the valid answer here.

8. IF the question was "find n such that 1+ 2+ ...+ n= 10" where the number are integers, start at 1, and are consectutive, yes, it is. But that was never said.

9. ## Ah yes...

Oops... sorry I jumped to conclusions there.... if the start integer is >1 and the integers summed are consecutive then:

If the start integer is 'm' then we can sum 1 to n and subtract the sum 1..(m-1)...
n(n+1)/2 - (m-1)m/2 = k // k = required total of course.
giving the Diophantine:
n^2 - m^2 + n + m - 2k = 0 // n.m.k are integers
And there's a whole lot of interesting stuff on the web about Diophantines.... but I'm not a mathematician, I just like this stuff.....

10. hmm.. nice reply.. still.. i dont understand.. hehe

ok first need to clear things up..

a+b+c = z

where a,b,c > 0

so i want to get a,b and c.

that what my question is.
if i said i want 4 values there will be a,b,c,d and the a,b,c,d must not be the same number

yes i know it can be any number
i want all possible number to get z

for example z=10 and required 2 value

a+b=z
1+9=10
2+8=10
3+7=10
4+6=10

it would not required any start integer... and i dont think diophantine is what im looking for... anyway thanks..

in programing i find using google.. they said print all possible combination.. similar to what im looking for but its not what i want.. its just if else programing..