add more help text

This commit is contained in:
filifa
2025-09-17 21:02:05 -04:00
parent 4b4858c54f
commit 9e6f648f0b
14 changed files with 126 additions and 42 deletions

View File

@@ -73,10 +73,16 @@ func mobius(cmd *cobra.Command, args []string) {
// mobiusCmd represents the mobius command
var mobiusCmd = &cobra.Command{
Use: "mobius",
Use: "mobius -n N",
Short: "Compute the Möbius function for all numbers less than n",
Long: `Compute the Möbius function for all numbers less than n.`,
Run: mobius,
Long: `Compute the Möbius function for all numbers less than n.
The Möbius function mu(n) is a multiplicative function defined as follows for prime p:
mu(p) = -1
mu(p^k) = 0 for k > 1
This means for squarefree n, mu(n) = -1 if n has an odd number of prime factors and mu(n) = 1 if n has an even number of prime factors. mu(n) = 0 if n is not squarefree.`,
Run: mobius,
}
func init() {