For any positive integer $n \in A= \mathbb{Z}$ we set
$$
\sigma(n) = \sum\_{d \mid n,\, d >0} d.
$$


J. T. B. Beard's algorithm on the title may be converted in
the following algorithm:


(i)
Take $n=n\_0$ a `well chosen` positive element of $A.$


(ii)
If $n \mid \sigma(n)$ STOP and output $n.$


(ii)
 if $n \nmid \sigma(n)$ then replace $n$ by
$$
lcm(n,\sigma(n))
$$
and come back to (ii)


Question: For which positive integers $n\_0$ l'algorithm stops after a finite number of steps. 
Assume that a positive integer $n \in A$ satisfies $n \mid \sigma(n).$ There exists a positive integer $n\_0 \neq n$
such that by taking $n=n\_0$ in (i) the algorithm stops after a finite number of steps and outputs $n$?


Example: With $n\_0=2$ we catch $n=6$ that satisfies $n \mid \sigma(n).$


More involved examples can be obtained with a small computer program;
(or by hand depending on taste...).



J. T. B. Beard's algorithm  may catch `multi-perfect numbers` too
**Later thoughts** Up to 100,000 there are 159 starting values which lead to a multiply perfect number in 1 to 6 steps. If we take the smallest starting value which leads to each terminal value one has these 80 values: 2, 3, 5, 9, 16, 18, 30, 33, 64, 72, 98, 117, 128, 176, 234, 256, 384, 504, 512, 528, 819, 896, 1008, 1215, 1419, 1485, 1638, 1792, 1911, 2002, 2295, 2304, 2430, 2720, 2970, 3456, 3570, 4131, 4608, 4864, 5120, 7120, 7644, 8262, 8960, 9009, 9720, 10240, 13104, 14280, 15360, 16128, 16384, 16896, 18018, 19008, 21360, 25600, 29127, 30272, 30720, 32640, 34048, 35840, 41472, 50688, 51840, 55296, 59904, 65536, 71680, 73440, 73728, 81920, 82368, 82944, 86400, 90112, 93312, 95040.


These include some Mersenne primes $2^P-1$ which are the only starting values which lead to an even perfect number.




---


I'm not sure how one would know when to stop (although I could believe that there are ways to know...) I checked the starting numbers up to 10,000 giving up when $lcm(n,\sigma(n))>10^{200}$. There were 97 starting values which lead to a multiply perfect number. The largest output was from 2304 to 181742883469056 


($1.8\cdot 10^{14}$) in 4 steps . Here is how often each number of steps showed up: [[0, 6], [1, 26], [2, 17], [3, 24], [4, 20], [5, 2], [6, 2]].


Here are the frequencies within ranges of length 500:


[0, 499], 37], [[500, 999], 9], [[1000, 1499], 8], [[1500, 1999], 6], [[2000, 2499], 7], [[2500, 2999], 3], [[3000, 3499], 2], [[3500, 3999], 2], [[4000, 4499], 4], [[4500, 4999], 3], [[5000, 5499], 1], [[5500, 5999], 1], [[7000, 7499], 1], [[7500, 7999], 1], [[8000, 8499], 7], [[8500, 8999], 2], [[9000, 9499], 2], [[9500, 9999], 1]


The OEIS list 23 multiply perfect numbers up to about $6\*10^{10}$ between them they have 6631 divisors (most shared). Of these 336 get back to a multiply perfect number (not including starting at numbers which are already multiply perfect). Each number on the list does have a starter that gets to it, but some only have one and most often one gets there in one step if at all. Here are the results:



```
                           6, 2, 4, [1, 1]
                          28, 2, 6, [1, 1]
                         120, 3, 16, [1, 3]
                         496, 2, 10, [1, 1]
                 672, 3, 24, [1, 3], [2, 1], [3, 2]
                         8128, 2, 14, [1, 1]
                        30240, 4, 96, [1, 5]
            32760, 4, 96, [1, 4], [2, 2], [3, 3], [4, 1]
                523776, 3, 80, [1, 6], [2, 2], [3, 1]
                   2178540, 4, 216, [1, 8], [2, 3]
          23569920, 4, 320, [1, 9], [2, 3], [3, 2], [4, 2]
                       33550336, 2, 26, [1, 1]
                  45532800, 4, 384, [1, 5], [2, 3]
 142990848, 4, 480, [1, 15], [2, 7], [3, 8], [4, 2], [5, 2], [6, 2]
          459818240, 3, 288, [1, 6], [2, 4], [3, 2], [4, 2]
             1379454720, 4, 576, [1, 29], [2, 7], [3, 4]
             1476304896, 3, 224, [1, 6], [2, 7], [3, 1]
                      8589869056, 2, 34, [1, 1]
       14182439040, 5, 1920, [1, 20], [2, 16], [3, 7], [4, 4]
       31998395520, 5, 2304, [1, 18], [2, 15], [3, 10], [4, 1]
            43861478400, 4, 1056, [1, 11], [2, 7], [3, 2]
             51001180160, 3, 480, [1, 8], [2, 4], [3, 4]
        66433720320, 4, 896, [1, 20], [2, 7], [3, 2], [4, 2]

```

The line N=1476304896, 3, 224, [1, 6], [2, 7], [3, 1] says that the first number is 2-perfect ($\sigma(N)=3N$) it has 224 divisors (including 1 and itself) of these 14 get back to N in 1 to 3 steps.


