Shifted Pythagorean Triples (noch nicht übersetzt)

Problem 730

For a non-negative integer k, the triple (p,q,r) of positive integers is called a k-shifted Pythagorean triple if p2+q2+k=r2

(p,q,r) is said to be primitive if gcd(p,q,r)=1.

Let Pk(n) be the number of primitive k-shifted Pythagorean triples such that 1pqr and p+q+rn.
For example, P0(104)=703 and P20(104)=1979.

Define S(m,n)=mk=0Pk(n) You are given that S(10,104)=10956.

Find S(102,108)