The function can be defined recursively in the following way.
If $a$ and $b$ are different primes then
$$f(a^m \cdot b^n)= a^r\cdot b^s \tag{1}$$ so we can use the function $e$ that uses and calculates the exponents of the primes instead of $f$ and $1$ can be written as
$$e(m,n)=(r,s)\tag{2}$$
We have
$$f(a^m\cdot b^n)=\prod\limits_{i=0,\ldots,m\\ j=0,\ldots,n\\ (i,j)\ne(m,n)} f(a^i\cdot b^j)\tag{3}$$
and therefore
$$e(m,n)=\sum\limits_{i=0,\ldots,m\\ j=0,\ldots,n\\ (i,j)\ne(m,n)} e(i, j)\tag{4}$$
The area of the praxial rectangle defined by $A(m, n)$ is the area of the praxial rectancle defined by $B$ plus the area of the praxial rectancle defined by $C$ minus the area of the praxial rectancle defined by $D$.
And similar: The number of grid points in the praxial rectangle defined by $A(m, n)$ is the number of grid points of the praxial rectancle defined by $B$ plus the number of grid points of the praxial rectancle defined by $C$ minus the number of grid points of the praxial rectancle defined by $D$.

So the arguments of $e$ in the sum are all grid points contained in the paraxial rectangle determined by $A=(m,n)$. This rectangle is defined as
$$R(m,n)=\{(i,j),i=0,\ldots,m; j=0\ldots,n\}\tag{5}$$ then
$$e(m,n)=e(A)=\sum\limits_{(u,v)\in R(A)\setminus
\{A\}}e(u,v)\tag{6}$$
$$= \sum\limits_{(u,v)\in R(B)}e(u,v)+\sum\limits_{(u,v)\in R(C)}e(u,v)-\sum\limits_{(u,v)\in R(D)}e(u,v)\tag{7}$$
But we have
$$e(B)=\sum\limits_{(u,v)\in R(B)\setminus
\{B\}}e(u,v)\tag{8}$$
if the coordinates of $B$ are larger or equal than $3.$
So in this case we have
$$\sum\limits_{(u,v)\in R(B)}e(u,v)=e(B)+\sum\limits_{(u,v)\in R(B)\setminus
\{B\}}e(u,v)=e(B)+e(B)\tag{9}$$
and similar holds for the other two sums so we finally get
$$ e(m,n)=2e(m-1,n)+2e(m,n-1)-2e(m-1,n-1), \\ \forall m,n:\; m+n>2, (m,n)\not \in \{(2,1), (1,2)\},m>0, n>0\tag{10}$$
Further we have
$$e(0,0)=(0,0)\\
e(1,0)=(1,0)\\
e(0,1)=(0,1)\\
e(2,0)=(1,0)\\
e(1,1)=(1,1)\\
e(0,2)=(0,1)\\
e(2,1)=(3,2)\\
e(1,2)=(2,3)
\tag{11}$$
and
$$
e(m,0)=2e(m-1,0)\\
e(0,n)=2e(0,n-1) \tag{12}
$$
From $(11)$ and $(12)$ we get
$$e(m,0)=(2^{m-1},0), \forall m>0\\
e(0,n)=(0,2^{n-1}), \forall n>0 \tag{12.1}
$$
But I don't know how to solve this recursion.
Here is the code of the function e in Maxima
e[0,0]:[0,0];
e[1,0]:[1,0];
e[0,1]:[0,1];
e[2,0]:[1,0];
e[1,1]:[1,1];
e[0,2]:[0,1];
e[2,1]:[3,2];
e[1,2]:[2,3];
e[m,n]:=if (m=0) then 2*e[m,n-1] else (
if (n=0) then 2*e[m-1,n]
else 2*e[m,n-1]+2*e[m-1,n]-2*e[m-1,n-1]);
/* solution function of Michael */
sol(m,n):=2^(m-2)*if evenp(n) then
sum(combination(m+n+2*i-1,2*i)*(-1)^(n/2-i)*combination(n,n/2-i),i,0,n/2)
else
sum(combination(m+n+2*i,2*i+1)*(-1)^((n-1)/2-i)*combination(n,(n-1)/2-i),i,0,(n-1)/2);
From the calculations in the OP we see that
$$\begin{eqnarray}
e(1,m)&=&\left(2^{m-1},\right.& \left. 2^{m-2}(m+1)\right) \\
e(2,m)&=&\left(2^{m-1}(m+2),\right.& \left. 2^{m-2}\frac{m^2+5m+2}{2}\right)\\
e(3,m)&=&\left(2^{m-1}\frac{m^2+7m+8}{2},\right.& \left. 2^{m-2}\frac{m^3+12m^2+29m+6}{6}\right)\\
e(4,m)&=&\left(2^{m-1}\frac{m^3+15m^2+56m+48}{6},\right.& \left. 2^{m-2}\frac{m^4+22m^3+131m^2+206m+24}{24}\right)
\end{eqnarray}$$
Michael proposed
$$s(m,n)=\begin{cases}
2^{m-2}\sum\limits_{i=0}^{\frac{n}{2}}(-1)^{\frac{n}{2}-i}{m+n+2i-1 \choose 2i}{n\choose \frac{n}{2}-i} & n\equiv 0 \pmod 2\\
2^{m-2}\sum\limits_{i=0}^{\frac{n-1}{2}}(-1)^{\frac{n-1}{2}-i}{m+n+2i \choose 2i}{n\choose \frac{n-1}{2}-i}& n\equiv 1 \pmod 2
\end{cases}
$$
This math.stackexchange by Ross Milikan says that the solution of
$$F(m,n) = F(m-1,n) + F(m,n-1)\\
F(m,0)=F(0,n)=1 \tag{13}$$
is
$$F(m,n)={{m+n}\choose{m}} \tag{14}$$
If we set $$e(m,n)=2^{m+n}h(m,n) \tag{15}$$ an substitute this in $(10) then we get
$$ 2^{m+n}g(m,n)=2^{m+n}g(m-1,n)+2^{m+n}g(m,n-1)-2^{m+n-1}g(m-1,n-1)\tag{16}$$
and further
$$ g(m,n)=g(m-1,n)+g(m,n-1)-\frac{1}{2}g(m-1,n-1)\tag{17}$$
and
$$g(m,0)=(\frac{1}{2},0)\\
g(0,n)=(0,\frac{1}{2})
$$
The solution function $g$ of $(17)$ is smaller than the solution function $F$ of $(13)$
, because we add additionally a negative amount on the right side. So we can conlude that
$$g(m,n)\le{m+n\choose m}\tag{18}$$
and further
$$e(m,n)\le \left(2^{m+n}{m+n\choose m},2^{m+n}{m+n\choose m}\right)\tag{19}$$
So this is an upper bound for $e(m,n)$
But I don't know how t solve it.
– miracle173 Jan 21 '18 at 08:37