Hello everyone,

I'm sure this problem can interest some of you. I need the answers for a research project. I currently don't know the answers.

Let n,m be two positive integers.
we consider this number

 D(n,m) = n^2 + nm + m^2

Let S denote the sorted list of values which can be reached by D(n,m).

For example :

S_0 = D(0,0) = 0,
 S_1 = D(0,1) = 1,
 S_2 = D(1,1) = 3,
 S_3 = D(0,2) = 4,
 S_4 = D(0,3) = 9,
 S_5 = D(2,2) = 12,...


Now here come the questions :

Let k be an integer.

- What is the value of S_k ?

- How many different couples (n,m) verify D(n,m) = S_k ?

Let denote this number t_k.

- What is \sum_{k=0}^{p} t_k ?

Let denote s_p this last sum.

- For s_p given, find the corresponding p. This last one should not be too hard to find if s_p is found as an analytic function of p (we just need to inverse it then), but I am not sure it's possible .

Many thanks for your help.