1: Formula for the number of Goldbach partitions.
Let $g\left(n\right)$ denote the number of Goldbach partitions of even integer $2n$:
$$g_{\left(n\right)}=\sum_{3\leq p\leq2n-3}\left[\pi\left(2n-p\right)-\pi\left(2n-p-1\right)\right]$$
where $p$ is odd prime and $\pi\left(n\right)$ is the number of primes less than or equal to $n$.
This is literally the definition of $g_{\left(n\right)}$, since $\pi\left(n\right)-\pi\left(n-1\right)$ will return $1$ if $n$ is prime and $0$ if $n$ is composite, this will count the number of times $2n-p$ is prime for all primes $p$ from $3$ to $2n-3$.
2: Relation with the prime omega function.
Now let's extend the definition of Goldbach partitions to:
$$2n=kp+q$$
where $p$ and $q$ are odd primes and $k$ is odd.
Because $kp$ can form any odd integer $<2n$, we observe that each prime factors of each integer $2n-p$ within $3\leq p\leq2n-3$ can be isolated as $q$ with some $k$, which also means that:
$$\sum_{_{3\leq p\leq2n-3}}\sum_{_{1\leq k\leq2n-3}}\left[\pi\left(2n-kp\right)-\pi\left(2n-kp-1\right)\right]=\sum_{_{3\leq p\leq2n-3}}\omega\left(2n-p\right)$$
where $p$ is odd prime, $k$ is odd, and $\omega\left(n\right)$ is the number of distinct prime factors of $n$.
Since the cases with $k=1$ are the Goldbach partitions, we rearrange like this:
$$g_{\left(n\right)}=\sum_{_{3\leq p\leq2n-3}}\omega\left(2n-p\right)-\sum_{_{3\leq p\leq2n-3}}\sum_{_{3\leq k\leq2n-3}}\left[\pi\left(2n-kp\right)-\pi\left(2n-kp-1\right)\right]$$
Now if we take a closer look at:
$$\sum_{_{3\leq k\leq\frac{2n-3}{p}}}\left[\pi\left(2n-kp\right)-\pi\left(2n-kp-1\right)\right]$$
we see that it is equal to the number of primes of the form $pk+\left(2n-3p\right)\mod p$ less than or equal to $2n-3p$, therefore we can replace it with the modular prime counting function:
$$g_{\left(n\right)}=\sum_{_{3\leq p\leq2n-3}}\omega\left(2n-p\right)-\sum_{_{3\leq p\leq2n-3}}\pi_{p,b}\left(2n-3p\right)$$
where $b=\left(2n-3p\right)\mod p$ and $\pi_{a,b}\left(n\right)$ denotes the number of primes of the form $ak+b$ less than or equal to $n$.
The final formula is the following, and works as expected:
$$g_{\left(n\right)}=\sum_{_{3\leq p\leq2n-3}}\omega\left(2n-p\right)-\sum_{_{3\leq p\leq\frac{2n-3}{3}}}\pi_{p,b}\left(2n-3p\right)$$
Note that the second sum is taken over $3\leq p\leq\frac{2n-3}{3}$ because $2n-3p<0$ for any $p>\frac{2n-3}{3}$.
4: Relation with the prime factorization of $2n$
If $p$ is a prime factor of $2n$, then $b=0$, and so $\pi_{p,b}\left(2n-3p\right)=1$. This means that $g_{\left(n\right)}$ depends on the prime factorization of $2n$. For example, if $2n\equiv0\mod3$, the largest instance of $\pi_{p,b}\left(2n-3p\right)$ in the second sum is replaced with $1$, which is why multiple of $3$ tend to have a large number of Goldbach partitions, while when $n$ is prime, the number of partitions tend to be small.
My question:
Is it ok to assume that if $n$ is not a prime number, $\sum_{_{3\leq p\leq\frac{2n-3}{3}}}\pi_{p,b}\left(2n-3p\right)$ will necessarily be smaller than if $n$ is a prime number, and since we know that for any prime $n$, $g\left(n\right)\geq1$, wouldn't it prove that $g\left(n\right)\geq1$ for all $n$ ?