Re: N = a^2 + b^2 + c^2 question

American Citizen <[email protected]> Mon, 17 Nov 2025 18:12:25 -0800
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
Hello all:

I guess I was too lenient in stating what I wanted.

339 is indeed the count of representations of 3 squares a,b,c where a <= 
b <= c  and a,b,c are all unique and > 0 for n = 416666.

I am continuing this study, and very interestingly, prime numbers or 2 * 
prime numbers are coming up which provide the maximum count of triads to 
a given bound. I also discovered that an asymptotic formula a*x^b seems 
to describe the relationship of the count of triads versus the number.

Can image files be posted to this group?

Randall

On 11/17/25 06:28, Max Alekseyev wrote:
> There is an analytical formula for this count - see
> https://en.wikipedia.org/wiki/Sum_of_squares_function#k_=_3
>
> Regards,
> Max
>
>
> On Mon, Nov 17, 2025 at 4:59 AM Bill Allombert 
> <[email protected]> wrote:
>
>     On Sun, Nov 16, 2025 at 05:32:52PM -0800, American Citizen wrote:
>     > In trying to obtain a fast but exhaustive algorithm for finding
>     3 squares
>     > which sum to a given number n, I found that using n = 416666, I
>     obtained 339
>     > unique representations of [a,b,c] such that a^2+b^2+c^2 = n.
>     >
>     > Can anyone verify that this count is correct for n?
>
>     Yes this is correct. Using the most straightword way:
>     ?
>     my(c=0);forvec(v=[[0,1000],[0,1000],[0,1000]],if(norml2(v)==416666,c++;print(c,":",v)),1);print(c);
>     %1 = 339
>
>     Cheers,
>     Bill.
>