# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Find integers representable as the sum of consecutive squares

Contributed by:
Jan Mangaldan

ResourceFunction["ConsecutiveSquareSum"][ finds integers that can be represented as sums of both | |

ResourceFunction["ConsecutiveSquareSum"][ finds |

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*.

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]= |

- 1.0.0 – 10 February 2021

This work is licensed under a Creative Commons Attribution 4.0 International License