Hardy-Ramanujan Journal |
We consider a $q$-analog $r_2(n, q)$ of the number of representations of an integer as a sum of two squares $r_2(n)$. This $q$-analog is generated by the expansion of a product that was studied by Kronecker and Jordan. We generalize Jacobi's two squares formula from $r_2(n)$ to $r_2(n, q)$. We characterize the signs in the coefficients of $r_2(n, q)$ using the prime factors of $n$. We use $r_2(n, q)$ to characterize the integers which are the length of the hypotenuse of a primitive Pythagorean triangle.