- Actually David gave simply the g.f. (generating function) of the sequence

f(n)=floor((n^2+4*n+24)/48)

In some sense there is no "higher" number theory involved in this

(at least it does not at all refer to primes).

AFAICS David did not explain why

f(prime(n)) = A025428(prime(n)^2)

(which is Mark's A216374).

Maximilian - --- In primenumbers@yahoogroups.com, Maximilian Hasler <maximilian.hasler@...> wrote:

> Actually David gave simply the g.f. (generating function) of the sequence

Indeed. It seemed to me that

> f(n)=floor((n^2+4*n+24)/48)

g(x) = x^4/((1-x)*(1-x^3)*(1-x^8)) = suminf(n=0,f(n)*x^n)

made Mark's conjecture

> f(prime(n)) = A025428(prime(n)^2)

look neater. I made no attempt to prove the conjecture.

David - There is a formula for r_4(n), when you allow zeros and distinguish signs

and order, see http://mathworld.wolfram.com/SumofSquaresFunction.html

r_4(n)=8*sumdiv(n,d,d*(d%4>0)), and this is for n=p^2 (when p>2 prime) is

r_4(p^2)=8*(p^2+p+1).

Essentially you count every 2^4*4! of these terms (the possibility of zero

and two equal terms is small), this gives r_4(p^2)/16/24~p^2/48+O(p), so

your conjecture is in the right order of magnitude.

[Non-text portions of this message have been removed] - I hacked together another formula, one which does away with the floor function and instead uses the mod (%) function.

f2 = ( ( n^2 + 4*n + (19 * (5 * (n % 48) + 2 )^2 ) % 48) - 24) /48

However it doesn't work for the primes n = 3 (and 2).

If anyone knows how to clean up this obscure form, I would be interested!

Mark

--- In primenumbers@yahoogroups.com, "Mark" <mark.underwood@...> wrote:

>

> How many ways can the square of an odd prime n be expressed as the sum of four non zero squares?

>

> The answer surprisingly appears to have the formula:

>

> f = floor((n^2+4*n+24)/48.)

>

> Here's a GP Pari program which counts the number of ways that an odd prime n can be written as the sum of four non zero squares, and compares that count (k) with the formula derivation f = floor((n^2+4*n+24)/48.) .

>

>

> forprime(n=3,100, k=0; for(s1=1,sqrt((n^2)/4),for(s2=s1,sqrt((n^2 - s1^2)/3) ,for(s3=s2,sqrt((n^2-s1^2 - s2^2)/2) ,if(issquare(n^2-s1^2-s2^2-s3^2),k++)))) ; f = floor((n^2+4*n+24)/48.) ; print1([n,k,f]" "))

>

>

>

> [3, 0, 0] [5, 1, 1] [7, 2, 2] [11, 3, 3] [13, 5, 5] [17, 7, 7] [19, 9, 9] [23, 13, 13] [29, 20, 20] [31, 23, 23] [37, 32, 32] [41, 38, 38] [43, 42, 42] [47, 50, 50] [53, 63, 63] [59, 77, 77] [61, 83, 83] [67, 99, 99] [71, 111, 111] [73, 117, 117] [79, 137, 137] [83, 150, 150] [89, 172, 172] [97, 204, 204]

>

>

> Does it always hold? I'm not sure as I have no proof.

>

>

> Early last week I submitted the sequence 0,1,2,3,5,7,9,13,20... to OEIS (but have not heard back).

>

>

> Mark

>