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 ππ¦
π¦ where this page comes from
- debian bookworm: mathomatic-primes 16.0.5-5 Β· LGPL-2.1-or-later
- debian trixie: mathomatic-primes 16.0.5-5 Β· LGPL-2.1-or-later
- fedora 43: mathomatic-tools 16.0.5-35.fc43 Β· LicenseRef-Callaway-LGPLv2
- fedora 44: mathomatic-tools 16.0.5-36.fc44 Β· LicenseRef-Callaway-LGPLv2
- ubuntu jammy: mathomatic-primes 16.0.5-4 Β· LGPL-2.1-or-later
- ubuntu noble: mathomatic-primes 16.0.5-5 Β· LGPL-2.1-or-later
- ubuntu questing: mathomatic-primes 16.0.5-5.1
- ubuntu resolute: mathomatic-primes 16.0.5-5.1build1 Β· LGPL-2.1-or-later
- ubuntu stonking: mathomatic-primes 16.0.5-5.1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms