Revision 39e659ce-d3cc-4a8c-acb6-d7ba8160f513 - Code Golf Stack Exchange

# [Brachylog], 17 bytes

Generates all the numbers for a given \$n\,ドル including duplicates.

 ;.{tfk+}ᵃ⁽{k≠&t}ℕ

[Try it online!][TIO-km55k7dr]

[Brachylog]: https://github.com/JCumin/Brachylog
[TIO-km55k7dr]: https://tio.run/##ATYAyf9icmFjaHlsb2cy/3vihrDigoLhuol94bag/zsue3Rmayt94bWD4oG9e2viiaAmdH3ihJX//zI "Brachylog – Try It Online"

### How it works

 ;.{tfk+}ᵃ⁽{k≠&t}ℕ implicit input n
 ;. [n, output]
 { }ᵃ⁽ starting with [output], generate a list
 by applying {…} n times:
 t the last element's
 f factors
 k without itself
 + summed
 -> [220, 284, 220]
 {k≠&t} the generated list must fulfill:
 k≠ without the last element, all elements are different
 &t and the tail
 is the implicit output

AltStyle によって変換されたページ (->オリジナル) /