Revision 54e5c851-e550-4d40-b31f-00922b3e09aa - Code Golf Stack Exchange
# [Charcoal], 53 bytes
Nθ≔⁰ζFN«≔⟦⟧υW⁻θ⊕⌕υζ«≦⊕ζ≔ζη≔⟦⟧υFθ«≔↨Φη∧μ¬﹪ημ¹η⊞υη»»»Iζ
[Try it online!][TIO-km5bd9ru] Link is to verbose version of code. Takes `n` and `m` as inputs and outputs the `m`th number, including duplicate sequences. Very slow so in practice you need `n<3`. Explanation:
Nθ
Input `n`.
≔⁰ζ
Start at zero.
FN«
Repeat `m` times.
≔⟦⟧υ
Clear any previous calculation.
W⁻θ⊕⌕υζ«
Repeat until a perfect `n`-cycle is found.
≦⊕ζ
Increment the test number.
≔ζη
Make a copy of the number.
≔⟦⟧υ
Start building a list of divisor sums.
Fθ«
Repeat `n` times.
≔↨Φη∧μ¬﹪ημ¹η
Calculate the next divisor sum.
⊞υη
Save it to the list.
»»»Iζ
Output the final result.
[Charcoal]: https://github.com/somebody1234/Charcoal
[TIO-km5bd9ru]: https://tio.run/##TY69CsIwGEXn9Cm@8QtE8Gd0UkFwqLiLQ2yjCaSJzY@C4rPH1FopZLnJzTm3ktxVluuUduYWwz42Z@Gwpcti5b26GpwyeOZ0sQ5wXKEUXgX5lY4nBjG3yEMqLQBLZaLHlsHOVE40wgRR41aZGmOHo/1nUvLbDzDq9T4yoJ8M5Dj/VeQ7qe1Jw@uae5FFOuSFksEqGxsGexuwtHXUtrtsOj@DGR3I5BC97Jb18V3k8y4OTpmAG@4D5sXLlOawSJO7/gA "Charcoal – Try It Online"