I have a function and I want to check that only 1 argument is accepted. Is this the right way to use CheckArguments?
AliquotSequence // ClearAll
AliquotSequence::usage = "AliquotSequence[num] returns the aliquot sequence of num."
AliquotSequence[num_?PositiveIntegerQ] :=
Catenate[
FindTransientRepeat[
NestWhileList[DivisorSigma[1, #] - # &, num,
DivisorSigma[1, #] - # != # &, 1, 99] /. {list___, 0} -> {list},
2]]
AliquotSequence[args___] := Null /; CheckArguments[AliquotSequence[args], 1]
I based this on a response from ChatGPT 4, so I thought it might be worth testing to see if it was right. I tested a function with a similar definition and it seemed to work as intended. I looked at CheckArguments documentation but it was kind of confusing because it used an option, which I don't need.