Post History
Jelly, 6 bytes _ÆṣṠ)Ġ Try it online! In order of abundant, perfect, deficient. _ÆṣṠ)Ġ Main Link ) For each from 1 to N _ Subtract Æṣ The proper divisor sum Ṡ Sign ...
Answer
#3: Post edited
# [Jelly], 7 bytesÆs_ḤṠ)Ġ[Try it online!][TIO-kpzllyif]- [Jelly]: https://github.com/DennisMitchell/jelly
[TIO-kpzllyif]: https://tio.run/##y0rNyan8//9wW3H8wx1LHu5coHlkwf///w0NDAA "Jelly – Try It Online"In order of deficient, perfect, abundant.- ```
Æs_ḤṠ)Ġ Main Link) For each number from 1 to NÆs Divisor sum_ SubtractḤ Double the input (proper divisor sum is just divisor sum - input)Ṡ Sign; -1 for deficient, 0 for perfect, 1 for abundantĠ Group equal elements' indices- ```
- # [Jelly], 6 bytes
- _ÆṣṠ)Ġ
- [Try it online!][TIO-kpzm4bc4]
- [Jelly]: https://github.com/DennisMitchell/jelly
- [TIO-kpzm4bc4]: https://tio.run/##y0rNyan8/z/@cNvDnYsf7lygeWTB////DQ0MAA "Jelly – Try It Online"
- In order of abundant, perfect, deficient.
- ```
- _ÆṣṠ)Ġ Main Link
- ) For each from 1 to N
- _ Subtract
- Æṣ The proper divisor sum
- Ṡ Sign of the difference
- Ġ Group equal elements' indices
- ```
#2: Post edited
- # [Jelly], 7 bytes
- Æs_ḤṠ)Ġ
- [Try it online!][TIO-kpzllyif]
- [Jelly]: https://github.com/DennisMitchell/jelly
[TIO-kpzllyif]: https://tio.run/##y0rNyan8//9wW3H8wx1LHu5coHlkwf///w0NDAA "Jelly – Try It Online"
- # [Jelly], 7 bytes
- Æs_ḤṠ)Ġ
- [Try it online!][TIO-kpzllyif]
- [Jelly]: https://github.com/DennisMitchell/jelly
- [TIO-kpzllyif]: https://tio.run/##y0rNyan8//9wW3H8wx1LHu5coHlkwf///w0NDAA "Jelly – Try It Online"
- In order of deficient, perfect, abundant.
- ```
- Æs_ḤṠ)Ġ Main Link
- ) For each number from 1 to N
- Æs Divisor sum
- _ Subtract
- Ḥ Double the input (proper divisor sum is just divisor sum - input)
- Ṡ Sign; -1 for deficient, 0 for perfect, 1 for abundant
- Ġ Group equal elements' indices
- ```