Skip to content

AbundantNumbers ​

The abundant numbers 12,18,20,24,…12, 18, 20, 24, … -- integers whose proper divisors sum past them -- as a lazy indexed collection.

AbundantNumbersthe nn with σ(n)−n>n\sigma(n) - n > n (proper-divisor sum exceeds nn), an infinite indexed collection.

Domain: Collections

Details
  • A lazy indexed collection: Count(AbundantNumbers)=+∞Count(AbundantNumbers) = +\infty, and At(AbundantNumbers,k)At(AbundantNumbers, k) unranks the kk-th abundant number by scanning forward from the last cached match -- At(AbundantNumbers,5)=30At(AbundantNumbers, 5) = 30.
  • OEIS A005101.
  • Membership goes through Element: Element(12,AbundantNumbers)Element(12, AbundantNumbers) is true, Element(28,AbundantNumbers)Element(28, AbundantNumbers) is false (perfect, not abundant).

Definition

Epsil, as the implementation runs it.

count()

PositiveInfinity

unrank(_r)

Apply(
       (sn_f: integer) => sn_f if sn_f > 0 else `NaN`,
       Fold(Function(
                      sn_s if sn_s > 0 else (sn_k if sn_s + _r == 0 else sn_s -
                                                                         1) if (0 if sn_k < 2 else Fold(
                                                                                                        Function(al_a +
                                                                                                                 (al_d if sn_k / al_d ==
                                                                                                                          al_d else al_d +
                                                                                                                                sn_k / al_d) if sn_k % al_d ==
                                                                                                                     0 else al_a, al_a, al_d),
                                                                                                        1,
                                                                                                        Range(2, Floor(Sqrt(sn_k)), 1),
                                                                                                      )) >
                                                                              sn_k else sn_s,
                      sn_s,
                      sn_k,
                    ), 0, Range(1, 6 * (_r + 1 + 1), 1)),
     )

rank(_x)

Fold(
      Function(
                sn_c + 1 if (0 if sn_k < 2 else Fold(
                                                      Function(
                                                                al_a +
                                                                (al_d if sn_k /
                                                                         al_d ==
                                                                         al_d else al_d +
                                                                               sn_k /
                                                                               al_d) if sn_k % al_d ==
                                                                    0 else al_a,
                                                                al_a,
                                                                al_d,
                                                              ),
                                                      1,
                                                      Range(
                                                             2,
                                                             Floor(Sqrt(sn_k)),
                                                             1,
                                                           ),
                                                    )) > sn_k else sn_c,
                sn_c,
                sn_k,
              ),
      0,
      Range(1, _x - 1, 1),
    ) if ((0 if _x < 2 else Fold(Function(
                                          al_a +
                                          (al_d if _x / al_d == al_d else al_d +
                                                                          _x /
                                                                          al_d) if _x % al_d == 0 else al_a,
                                          al_a,
                                          al_d,
                                        ), 1, Range(2, Floor(Sqrt(_x)), 1))) > _x if _x >= 1 else False) else -1

valid(_x)

(0 if _x < 2 else Fold(
                        Function(
                                  al_a + (al_d if _x / al_d == al_d else al_d +
                                                                         _x /
                                                                         al_d) if _x %
                                                                              al_d ==
                                                                              0 else al_a,
                                  al_a,
                                  al_d,
                                ),
                        1,
                        Range(2, Floor(Sqrt(_x)), 1),
                      )) > _x if _x >= 1 else False

Enumeration

Examples

Basic #

The first five abundant numbers

live ↗
InTake(AbundantNumbers,5)\mathrm{Take}(\mathrm{AbundantNumbers}, 5)Out[12,18,20,24,30]\bigl\lbrack12, 18, 20, 24, 30\bigr\rbrack
Properties #
live ↗
In12∈AbundantNumbers12∈\mathrm{AbundantNumbers}OutTrue\mathrm{True}

28 is perfect, not abundant

live ↗
In28∈AbundantNumbers28∈\mathrm{AbundantNumbers}OutFalse\mathrm{False}
About
Examples3
CrosswalkOEISmathlib4

See also: Count, At, Element, PrimeNumbers, SquareNumbers