Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find integers representable as the sum of consecutive squares
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. |
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]= |
Find five integers representable as the sum of 100 and 101 squares:
| In[5]:= |
| Out[5]= | ![]() |
Verify the first example:
| In[6]:= |
| Out[6]= |
This work is licensed under a Creative Commons Attribution 4.0 International License