someone posted this on quant thread a few weeks ago..... a very useful stuff..
Integral Solutions:
1) x+y+z+...(r terms) = n
Non negative solutions => (n+r-1)C(r-1)
Positive solns => (n-1)C(r-1)
2) ax+by= n
Non negative integeal solns => [n/lcm(a,b)]+1, if anyone of a or b is divisible by n, otherwise -1
For positive solns remove those including x/y=0 from non negative.
3) |x|+|y|= n has 4n solns
|x|+|y|+|z|=n has 4n^2+2 solns
where n => natural number
when n=0, only 1 soln
For n<0, no soln.
4) xy=N ,where N is natural number
Number of positive solns => Number of factors of N.
Integral soln => 2*Number of factors of N
5) xy= N
Number of unordered positive solns such that x and y are coprimes is 2^(n-1), where n is number of primes containing N.
6) x + y = N, where N => Natural number
Number of positive solutions such that x and y are coprime is Euler of N.
(If N=a^x*b^y, Euler(N)= N(1-1/a)(1-1/b)
7) i) a/x + b/y = 1/n
Number of positive integral solns => factors of a*b*n^2
Number of integral solns => 2*factors of a*b*n^2 - 1.
ii) a/x - b/y = 1/n
Number of integral solns => 2*factors of a*b*n^2 -1
Positive => factors of a*b*n^2 which lies below a*n
8) xyz= N = a^x*b^y
Number of ordered positive integral solns => (x+2)C2*(y+2)C2
Integqral solns => 4* (x+2)C2*(y+2)C2
9) x^2 - y^2 = N
Positive solns => Number of even*even or odd*odd factors if not perfect square otherwise -1
Integral = 4*positive solns
Zero solns if N = 4k+2 form as they are always odd*even form.
10) x^2 + y^2 = N
It will have integer solns only if N contains primes of the form 4k+1 type.
If all primes are 4k+1 type
Then positive solns => number of factors of N, (Be careful in case of perfect square) it will be -1 than
If it contains some 4k+3 primes with odd power then 0 solns
If it contains even powers of 4k+3 primes, then positive solns = number of factors of 4k+1 form only.
Integral solns = 4*positive solns