Arithmetic properties of a partition function vanishing coefficients in infinite product expansions and relations between sums of squares and triangular numbers