There are n retailers and each of them have copies of two novels left, titled “FIRST” and “SECOND”. Each retailer has a different number of copies of "FIRST", which is always more than the number of copies of "SECOND" stocked by that retailer.

It is observed that the sum of squares of the number of copies of FIRST and the number of copies of SECOND for each of the retailers is always equal to: (2^{2}+3^{2})(3^{2}+4^{2})(4^{2}+5^{2}).

For example, if the respective number of copies of FIRST and SECOND titles possessed by any given retailer i are x_{i} and y_{i}, then : x_{i}^{2}+y_{i}^{2} = (2^{2}+3^{2})(3^{2}+4^{2})(4^{2}+5^{2}); for all i = 1,2,....,n

How many retailers are there and how many copies of FIRST novel in total are available from all these (n) retailers?

Let the respective numbers of copies of FIRST and SECOND be p and q. Let S(p) denote the sum of copies of the FIRST comic book possessed by all the retailers.

By the problem p^2+ q^2 = (2^2 + 3^2)(3^2+4^2)(4^2+5^2) where p and q are positive integers and p> q.

We know that, x^2+y^2 = (A1^2+B1^2)( (A2^2+B2^2) has the positive integer solution
(x,y) = (A1*A2 + B1*B2, | A1*B2 – A2*B1|) ; (A1*B2 + A2*B1, | A1*A2 – B1*B2|).......(#)

Since, (3^2+4^2) = 5^2, we obtain: .

(2^2+3^2)(3^2+4^2) = 5^2(2^2+3^2) .

= 18^2+1^2 = 17^2+6^2 = 15^2+10^2.

Consequently, applying the relationship (#) recursively, we obtain: