if function has no output for encoded numbers above a given number is there anything special when representing the algebraic expression?

Example "1 if even, 0 otherwise.No output above 2."

| X Y

0 .. | 1

1 .. | 0

2 .. | 1

3 .. | x

So is this as simple as

Function = X'Y' + XY'

or is there anything else?

Thank.