Given a pair p, q of relative prime positive integers, we have uniquely determined positive integers x, y, u and v such that vx-uy = 1, p = x + y and q = u + v. Using this property, we show that$${\sum\limits_{1{\leq}i{\leq}x,1{\leq}j{\leq}v}}\;{t^{(i-1)q+(j-1)p}\;-\;{\sum\limits_{1{\leq}k{\leq}y,1{\leq}l{\leq}u}}\;t^{1+(k-1)q+(l-1)p}$$ is the Alexander polynomial ${\Delta}_{p,q}(t)$ of a torus knot t(p, q). Hence the number $N_{p,q}$ of non-zero terms of ${\Delta}_{p,q}(t)$ is equal to vx + uy = 2vx - 1. Owing to well known results in knot Floer homology theory, our expanding formula of the Alexander polynomial of a torus knot provides a method of algorithmically determining the total rank of its knot Floer homology or equivalently the complexity of its (1,1)-diagram. In particular we prove (see Corollary 2.8); Let q be a positive integer> 1 and let k be a positive integer. Then we have $$\begin{array}{rccl}(1)&N_{kq}+1,q&=&2k(q-1)+1\\(2)&N_{kq}+q-1,q&=&2(k+1)(q-1)-1\\(3)&N_{kq}+2,q&=&{\frac{1}{2}}k(q^2-1)+q\\(4)&N_{kq}+q-2,q&=&{\frac{1}{2}}(k+1)(q^2-1)-q\end{array}$$ where we further assume q is odd in formula (3) and (4). Consequently we confirm that the complexities of (1,1)-diagrams of torus knots of type t(kq + 2, q) and t(kq + q - 2, q) in [5] agree with $N_{kq+2,q}$ and $N_{kq+q-2,q}$ respectively.