MATHO-SUMSQ(1)

πŸ’– MATHO-SUMSQ(1) β€” the Mathomatic Utilities girlies' entry πŸ’–

okay so bestie, welcome to matho-sumsq, a little command-line utility that lives (optionally!) inside the mathomatic(1) package 🌸 she's here to find the minimum number of positive integers that, when you square each one and add them all up, equal the number you gave her. like, math but make it ✨decomposed✨


✨ NAME ✨

matho-sumsq β€” Find the minimum sum of the squares for integers πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

matho-sumsq [numbers]

πŸ’… DESCRIPTION πŸ’…

so this command-line utility is optionally part of the mathomatic(1) package. what she does is find the minimum number of positive integers that, when squared and added together, equal the given number. and here's the iconic part: there's a proof that no more than 4 squares summed together are ever required to represent any positive integer. four. that's the ceiling. periodt. πŸ‘‘

the command line may contain positive integers to find the minimum squares of, and they must be less than 2147483648 (2^31) on 32-bit systems, or less than 9223372036854775808 (2^63) on 64-bit systems. no cap, those are the limits bestie.

if "+" is appended to the given number, the program counts up from the given number β€” like she just keeps going, main character energy πŸ”₯

and if the minimum number of squares turns out to be 2, this program displays all possible combinations with 2 squares for the given number. otherwise? she just displays the first combination she finds. lowkey efficient, highkey fine. πŸ’β€β™€οΈ

if no command-line arguments are given, the program reads the numbers from standard input. yes bestie, she'll sit there and wait for you. 🫢


🌈 AUTHOR 🌈

George Gesslein II (gesslein@mathomatic.org) at "http://www.mathomatic.org". πŸ’œ


😭 REPORTING BUGS 😭

if you find a bug, please report it to the author or at "https://launchpad.net/mathomatic". not me begging you to file the bug πŸ’€ do it for her.


πŸ‘€ SEE ALSO πŸ‘€

the whole friend group, fr fr 🧚


kisses, this page came to you courtesy of Mathomatic, page MATHO-SUMSQ(1) πŸ’–βœ¨ slay responsibly, and remember: every positive integer is at most four squares away from being understood πŸŽ€πŸ¦‹