Hi all,

here is my problem. I have the following system :

Where , and areintegerunknowns and is any integer value (known)

Is there anygeneralway to solve such equations quickly (for all three unknowns) ? Thanks a lot !

Printable View

- November 25th 2009, 01:32 AMBacteriusSystem of two equations with three integer unknowns
Hi all,

here is my problem. I have the following system :

Where , and are*integer*unknowns and is any integer value (known)

Is there any*general*way to solve such equations quickly (for all three unknowns) ? Thanks a lot ! - November 25th 2009, 05:40 AMHallsofIvy
The first thing I notice is that adding the two equations gives . One obvious solution to that is a= 0. But that gives and [tex]a^2- ac- n= n= 0[/itex]. If n= 0, then a= 0 , b, c any integers satisfy the equations.

If a is not 0, we can divide through by it and get a- (b+c)= 0 so a= b+c. Putting that into the first equation we get so .

Putting a= b+ c into the last eqaution gives or and, now, . That means we must have and so .

If c= -b, we have, from a-(b+c)= a= 0 again.

If c= b, a-(b+c)= 0 becomes a- 2b= 0 so a= 2b. Given any integer, k, take a= 2k, b= c= k. The equation becomes .

If n> 0, that is impossible. The only solution is a=0, b, c any integers.

If n= 0, that gives k= 0. That is a= b= c= 0, which is included in "a= 0, b, c any integers above".

If n< 0, so that which is integer only if n is -3 times a square: [tex]n= -3m^2[tex], in which case .

That is:

If or n< 0 is**not**of the form for some integer m, then a=0, b, c any numbers is the only solution.

If , then a= 2m, b= c= m. - November 25th 2009, 05:16 PMBacterius
Well , and I know that (maybe it could help) (with new unknown of course)

And, , , (and ).

But it looks like I'm screwed, perhaps I need more information ? - November 30th 2009, 09:32 AMMedia_ManBrute Force Approach - General
Solve for a using the quadratic formula:

Now isolate b in terms of c:

Solution:

Simplify by multiplying by the conjugate: , or equivalently,

Substituting,

A better way of expressing the solution is by finding b,c such that , and let

For a to be an integer, must be even, so b,c must have the same parity (both even or both odd), so is even also.

An all-integer answer can thus be gotten: Given n, factor n, and find b,c satisfying , or . Define a as above.

This solution has the advantage of working for all -- there are no restraints on n. Given a random n, the number of a,b,c solutions is equivalent to the number of unique ways to factor , WLOG

Interestingly, a|n necessarily, so dividing through both equations by a, we arrive at the solution:

Given any integer n, choose a factor of n, a|n, and define b=a+n/a, c=a-n/a. We might have guessed at this solution from the start, but the preceding serves as a formal proof that it is the whole and only solution (aside from the trivial a=b=c=0, which works iff n=0). - December 7th 2009, 02:26 AMBingk
Just wanted to point out what may be an error in HallsofIvy's post .... if you divide by , you get that , and NOT

- December 7th 2009, 02:43 AMBacterius
- December 8th 2009, 03:56 PMBingk
hahahaha ... yeah, by a :)