Given that a and b are non-negative integers and f(x,y)=(x+y-a)(x+y-b), then if f(x,y)=0 has n distinct non-negative integer solutions for (x,y), find how many different polynomials f(x,y) can take.
Note: For example, (1,0) and (0,1) are not distinct solutions.
Well, let's first solve an easier problem: Given that a is a non-negative integer and (x+y-a) = 0 has n distinct non-negative integer solutions for (x,y), find a.
Well, if n = 1, then a = 0 or 1, because x + y = 0 implies (x,y) = (0,0) and x + y = 1 implies one distinct non-negative integral solutions, (0,1).
If n = 2 then a = 2 or 3, because x + y = 2 implies two distinct non-negative integral solutions, (0,2), and (1,1) and x + y = 3 implies two distinct solutions, (0,3) and (1,2).
If n = 3 then a = 4 or 5, because x + y = 4 implies three distinct solutions, (0,4), (1,3), (2,2) and x + y = 5 implies (x,y) is, (0,5), (1,4), or (2,3).
In general, a = (2n - 2) or (2n - 1).
*****************************************
In the original problem, the number of distinct polynomials is just the number of distinct values of (a,b). Note that (1,0) and (0,1) yield the same polynomial, and are not distinct.
If n = 1, then the distinct (a,b) must be (0,0) or (1,1). If (a,b) = (0,0) then (x,y) = (0,0). If (a,b) = (1,1) then (x,y) must equal (0,1).
If n = 2, then the distinct (a,b) must be equal to (2,2) or (3,3) or (also) (0,1). If (a,b) = (0,1) then (x,y) = (0,0) or (0,1). If (a,b) = (2,2) then (x,y) = (0,2) or (1,1). If (a,b) = (3,3) then (x,y) = (0,3) or (1,2).
If n = 3, then the distinct (a,b) must be equal to (4,4) or (5,5) or (0 or 1,2 or 3). By (0 or 1,2 or 3), I mean (0,2), (0,3), (1,2) or (1,3). Altogether, there are six distinct polynomials.
If n = 4, then the distinct (a,b) must be equal to (6,6) or (7,7) or (0 or 1,4 or 5) or (also) (2,3). By (0 or 1,4 or 5), I mean (0,4), (0,5), (1,4) or (1,5). Altogether, there are 7 distinct polynomials.
If n = 5, then the distinct (a,b) must be equal to (8,8) or (9,9) or (0 or 1,6 or 7) or (2 or 3,4 or 5), Altogether, there are 10 distinct polynomials.
If n = 6, then the distinct (a,b) must be equal to (10,10) or (11,11) or (0 or 1,8 or 9) or (2 or 3,6 or 7), or (also) (4,5). Altogether, there are 11 distinct polynomials.
In general,
if n is even, there are 2n distinct polynomials
if n is odd, there are 2n - 1 distinct polynomials