From: Knud Thomsen on
For the sum of two squares function (1):

r2(c) = number of integer pairs (x,y) for which x^2 + y^2 = c

consider the special arguments c' defined by:

r2(c') > sup{r2(d): d < c'}

A table of c' and r2(c') starts like this:

-------------------------------------------------------------------
c' r2(c') Factors of r2(c')
-------------------------------------------------------------------
1 4 1
5 8 5
25 12 5^2
65 16 5 13
325 24 5^2 13
1105 32 5 13 17
4225 36 5^2 13^2
-------------------------------------------------------------------
5525 48 5 (5 13 17)
27625 64 5^2 (5 13 17)
71825 72 5 13 (5 13 17)
138125 80 5^3 (5 13 17)
-------------------------------------------------------------------
160225 96 5 (5 13 17 29)
801125 128 5^2 (5 13 17 29)
2082925 144 5 13 (5 13 17 29)
4005625 160 5^3 (5 13 17 29)
-------------------------------------------------------------------
5928325 192 5 (5 13 17 29 37)
29641625 256 5^2 (5 13 17 29 37)
77068225 288 5 13 (5 13 17 29 37)
148208125 320 5^3 (5 13 17 29 37)
-------------------------------------------------------------------
243061325 384 5 (5 13 17 29 37 41) ?
1215306625 512 5^2 (5 13 17 29 37 41) ?
3159797225 576 5 13 (5 13 17 29 37 41) ?
6076533125 640 5^3 (5 13 17 29 37 41) ?
-------------------------------------------------------------------
12882250225 768 5 (5 13 17 29 37 41 53) ?
64411251125 1024 5^2 (5 13 17 29 37 41 53) ?
167469252925 1152 5 13 (5 13 17 29 37 41 53) ?
322056255625 1280 5^3 (5 13 17 29 37 41 53) ?
-------------------------------------------------------------------
785817263725 1536 5 (5 13 17 29 37 41 53 61) ?
3929086318625 2048 5^2 (5 13 17 29 37 41 53 61) ?
10215624428425 2304 5 13 (5 13 17 29 37 41 53 61) ?
19645431593125 2560 5^3 (5 13 17 29 37 41 53 61) ?
-------------------------------------------------------------------
57364660251925 3072 5 (5 13 17 29 37 41 53 61 73) ?
286823301259625 4096 5^2 (5 13 17 29 37 41 53 61 73) ?
745740583275025 4608 5 13 (5 13 17 29 37 41 53 61 73) ?
1434116506298125 5120 5^3 (5 13 17 29 37 41 53 61 73) ?
-------------------------------------------------------------------
5105454762421325 6144 5 (5 13 17 29 37 41 53 61 73 89) ?
25527273812106625 8192 5^2 (5 13 17 29 37 41 53 61 73 89) ?
66370911911477225 9216 5 13 (5 13 17 29 37 41 53 61 73 89) ?
127636369060533125 10240 5^3 (5 13 17 29 37 41 53 61 73 89) ?
-------------------------------------------------------------------

The entries annotated with '?' are tentative, as for the alleged c'
only r2(c') and r2(c'-1) were calculated. The preceding entries,
however, are based on exhaustive searches.

It seems like c' can be factored into primes congruent to 1 modulo 4,
reminding one of Fermat's theorem on sums of two squares and the
Brahmagupta–Fibonacci identity.

Any comments on the apparent regularity for c'>=5525: each time c'
doubles, the next prime congruent to 1 modulo 4 is added as a factor?

Best regards,
Knud Thomsen
Geologist, Denmark

References
1. Mathworld Sum of Squares Function
http://mathworld.wolfram.com/SumofSquaresFunction.html
From: Gerry on
On Jul 27, 9:36 pm, Knud Thomsen <sa...(a)kt-algorithms.com> wrote:
> For the sum of two squares function (1):
>
>   r2(c) = number of integer pairs (x,y) for which x^2 + y^2 = c
>
> consider the special arguments c' defined by:
>
>   r2(c') > sup{r2(d): d < c'}
>
> A table of c' and r2(c') starts like this:
>
> -------------------------------------------------------------------
>                 c'    r2(c')   Factors of r2(c')
> -------------------------------------------------------------------
>                  1       4     1
>                  5       8     5
>                 25      12     5^2
>                 65      16     5 13
>                325      24     5^2 13
>               1105      32     5 13 17
>               4225      36     5^2 13^2
> -------------------------------------------------------------------

<snip!>

> The entries annotated with '?' are tentative, as for the alleged c'
> only r2(c') and r2(c'-1) were calculated. The preceding entries,
> however, are based on exhaustive searches.
>
> It seems like c' can be factored into primes congruent to 1 modulo 4,
> reminding one of Fermat's theorem on sums of two squares and the
> Brahmagupta–Fibonacci identity.
>
> Any comments on the apparent regularity for c'>=5525: each time c'
> doubles, the next prime congruent to 1 modulo 4 is added as a factor?
>
> Best regards,
> Knud Thomsen
> Geologist, Denmark
>
> References
> 1. Mathworld Sum of Squares Function
>    http://mathworld.wolfram.com/SumofSquaresFunction.html

The column you have labeled Factors of r2(c') is, of course,
actually factorization of c'. On the other hand, when you
write of c' doubling, you actually mean r2(c') doubling.

Anyway, it is well-known and not terribly deep that if p
is prime, 1 mod 4, and not a factor of m, then r2(pm) = 2 r2(m).

Anyway anyway, have a look at
http://www.research.att.com/~njas/sequences/A071383
--
GM
From: Knud Thomsen on
On Jul 27, 2:50 pm, Gerry <ge...(a)math.mq.edu.au> wrote:
> On Jul 27, 9:36 pm, Knud Thomsen <sa...(a)kt-algorithms.com> wrote:
>
>
>
> > For the sum of two squares function (1):
>
> >   r2(c) = number of integer pairs (x,y) for which x^2 + y^2 = c
>
> > consider the special arguments c' defined by:
>
> >   r2(c') > sup{r2(d): d < c'}
>
> > A table of c' and r2(c') starts like this:
>
> > -------------------------------------------------------------------
> >                 c'    r2(c')   Factors of r2(c')
> > -------------------------------------------------------------------
> >                  1       4     1
> >                  5       8     5
> >                 25      12     5^2
> >                 65      16     5 13
> >                325      24     5^2 13
> >               1105      32     5 13 17
> >               4225      36     5^2 13^2
> > -------------------------------------------------------------------
>
> <snip!>
>
>
>
> > The entries annotated with '?' are tentative, as for the alleged c'
> > only r2(c') and r2(c'-1) were calculated. The preceding entries,
> > however, are based on exhaustive searches.
>
> > It seems like c' can be factored into primes congruent to 1 modulo 4,
> > reminding one of Fermat's theorem on sums of two squares and the
> > Brahmagupta–Fibonacci identity.
>
> > Any comments on the apparent regularity for c'>=5525: each time c'
> > doubles, the next prime congruent to 1 modulo 4 is added as a factor?
>
> > Best regards,
> > Knud Thomsen
> > Geologist, Denmark
>
> > References
> > 1. Mathworld Sum of Squares Function
> >    http://mathworld.wolfram.com/SumofSquaresFunction.html
>
> The column you have labeled Factors of r2(c') is, of course,
> actually factorization of c'. On the other hand, when you
> write of c' doubling, you actually mean r2(c') doubling.
>
> Anyway, it is well-known and not terribly deep that if p
> is prime, 1 mod 4, and not a factor of m, then r2(pm) = 2 r2(m).
>
> Anyway anyway, have a look athttp://www.research.att.com/~njas/sequences/A071383
> --
> GM

Many thanks, Gerry, for the references, something for me to dig into.
Yes, sorry about the incorrect table header.
Too bad I forgot to look up that c' integer sequence myself ..
Do you happen to have an (online) reference to a proof of the 'r2(pm)
= 2 r2(m)' relation at hand?
I mean, it may not be deep, but it isn't obvious to this layman ;-).

Knud
From: Gerry Myerson on
In article
<2ca34ee3-34c0-4f38-a5e6-d498c92c5517(a)m18g2000vbg.googlegroups.com>,
Knud Thomsen <sales(a)kt-algorithms.com> wrote:

> On Jul 27, 2:50�pm, Gerry <ge...(a)math.mq.edu.au> wrote:
> > On Jul 27, 9:36�pm, Knud Thomsen <sa...(a)kt-algorithms.com> wrote:
> >
> >
> >
> > > For the sum of two squares function (1):
> >
> > > � r2(c) = number of integer pairs (x,y) for which x^2 + y^2 = c
> >
> > > consider the special arguments c' defined by:
> >
> > > � r2(c') > sup{r2(d): d < c'}
> >
> > > A table of c' and r2(c') starts like this:
> >
> > > -------------------------------------------------------------------
> > > � � � � � � � � c' � �r2(c') � Factors of r2(c')
> > > -------------------------------------------------------------------
> > > � � � � � � � � �1 � � � 4 � � 1
> > > � � � � � � � � �5 � � � 8 � � 5
> > > � � � � � � � � 25 � � �12 � � 5^2
> > > � � � � � � � � 65 � � �16 � � 5 13
> > > � � � � � � � �325 � � �24 � � 5^2 13
> > > � � � � � � � 1105 � � �32 � � 5 13 17
> > > � � � � � � � 4225 � � �36 � � 5^2 13^2
> > > -------------------------------------------------------------------
> >
> > <snip!>
> >
> >
> >
> > > The entries annotated with '?' are tentative, as for the alleged c'
> > > only r2(c') and r2(c'-1) were calculated. The preceding entries,
> > > however, are based on exhaustive searches.
> >
> > > It seems like c' can be factored into primes congruent to 1 modulo 4,
> > > reminding one of Fermat's theorem on sums of two squares and the
> > > Brahmagupta�Fibonacci identity.
> >
> > > Any comments on the apparent regularity for c'>=5525: each time c'
> > > doubles, the next prime congruent to 1 modulo 4 is added as a factor?
> >
> > > Best regards,
> > > Knud Thomsen
> > > Geologist, Denmark
> >
> > > References
> > > 1. Mathworld Sum of Squares Function
> > > � �http://mathworld.wolfram.com/SumofSquaresFunction.html
> >
> > The column you have labeled Factors of r2(c') is, of course,
> > actually factorization of c'. On the other hand, when you
> > write of c' doubling, you actually mean r2(c') doubling.
> >
> > Anyway, it is well-known and not terribly deep that if p
> > is prime, 1 mod 4, and not a factor of m, then r2(pm) = 2 r2(m).
> >
> > Anyway anyway, have a look
> > athttp://www.research.att.com/~njas/sequences/A071383
> > --
> > GM
>
> Many thanks, Gerry, for the references, something for me to dig into.
> Yes, sorry about the incorrect table header.
> Too bad I forgot to look up that c' integer sequence myself ..
> Do you happen to have an (online) reference to a proof of the 'r2(pm)
> = 2 r2(m)' relation at hand?
> I mean, it may not be deep, but it isn't obvious to this layman ;-).

It comes from two things:
Every prime p = 1 mod 4 has a unique expression (up to order and signs)
as a sum of two squares, and
(a^2 + b^2)(c^2 + d^2)
= (a c + b d)^2 + (a d - b c)^2 = (a c - b d)^2 + (a d + b c)^2
which in turn comes from taking the modulus of
(r + s i)(u + v i) = (r u - s v) + (r v + s u) i
where i is a square root of minus one.

--
Gerry Myerson (gerry(a)maths.mq.edi.ai) (i -> u for email)