OK, here is my take on the problem. The highest value of the function is 19, so the ROM must have a 5-bit memory, unless there some bits in common with all the values of the function. The function can be simplied to x(x+y+2)+1 . x can 4 different values and y can have 2 different values. That means 4x2=8 different function values. The truth table is shown below.
Code:
x y f
-----------
00 0 1
00 1 1
01 0 4
01 1 5
10 0 9
10 1 11
11 0 16
11 1 19