Function Repository Resource:

# ConsecutiveSquareSum

Find integers representable as the sum of consecutive squares

Contributed by: Jan Mangaldan
 ResourceFunction["ConsecutiveSquareSum"][n] finds integers that can be represented as sums of both n and n+1 consecutive squares. ResourceFunction["ConsecutiveSquareSum"][n,k] finds k such integers.

## Details

ResourceFunction["ConsecutiveSquareSum"][n] returns a tuple {p,q,t}, where t is the sum of squares of n consecutive integers starting from p, and n+1 consecutive integers starting from q.

## Examples

### Basic Examples (2)

Find an integer that can be represented as the sum of two and three consecutive squares:

 In[1]:=
 Out[1]=

Check that 365 satisfies this property:

 In[2]:=
 Out[2]=

Find four integers that can be represented as the sum of two and three consecutive squares:

 In[3]:=
 Out[3]=

Check all the results:

 In[4]:=
 Out[4]=

### Scope (2)

Find five integers representable as the sum of 100 and 101 squares:

 In[5]:=
 Out[5]=

Verify the first example:

 In[6]:=
 Out[6]=

## Version History

• 1.0.0 – 10 February 2021