While many aliquot sequences terminate in the values c(prime_number, 1, 0), many numbers drop into a short loop or a repeating value (perfect numbers do this). If the sequence repeats or terminates, the sequence is returned. If either maxiter
is reached or the sequence drops into a loop (and thus maxiter
will be triggered), a warning notice is generated and the sequence so far is returned.