[Question]
  [
An [*Abundant number*](https://en.wikipedia.org/wiki/Abundant_number) is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are:
```
1, 2, 3, 4, 6
```
And summing these results in 16. Since 16 is larger than 12, 12 is abundant. Note that this does *not* include "Perfect numbers", e.g. numbers that are *equal* to the sum of its proper divisors, such as 6 and 28. 
Your task for today is to write a program or function that determines if a number is abundant or not. Your program should take a single integer as input, and output a [truthy/falsy](http://meta.codegolf.stackexchange.com/q/2190/31716) value depending on whether it is abundant or not. You can assume that the input will always be valid and greater than 0, so for bad inputs, undefined behavior is fine.
You may take your input and output in any reasonable format, for example STDIN/STDOUT, files, or arguments/return values would all be acceptable.
For reference, here are the abundant numbers up to 100:
```
12,
18,
20,
24,
30,
36,
40,
42,
48,
54,
56,
60,
66,
70,
72,
78,
80,
84,
88,
90,
96,
100
```
And more can be found on [A005101](http://oeis.org/A005101)
Since this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), standard loopholes are denied, and try to write the shortest possible code you can in whichever language you happen to choose!
  
[Answer]
# Regex (ECMAScript), ~~1085~~ ~~855~~ ~~597~~ ~~536~~ ~~511~~ ~~508~~ 504 bytes
Matching abundant numbers in ECMAScript regex is an entirely different beast than doing so in practically any other regex flavor. The lack of forward/nested backreferences or recursion means that it is impossible to directly count or keep a running total of anything. The lack of lookbehind makes it often a challenge even to have enough space to work in.
Many problems must be approached from an entirely different perspective, and you'll be wondering if they're solvable at all. It forces you to cast a much wider net in finding which mathematical properties of the numbers you're working with might be able to be used to make a particular problem solvable.
Back in March-April 2014 I constructed a solution to this problem in ECMAScript regex. At first I had every reason to suspect the problem was completely impossible, but then the mathematician [teukon](https://gist.github.com/teukon) sketched an idea that made an encouraging case for making it look solvable after all – but he made it clear he had no intention of constructing the regex (he had competed/cooperated with my on constructing/golfing previous regexes, but reached his limit by this point and was content to restrict his further contributions to theorizing).
Solving unary mathematical problems in ECMAScript regex has been a fascinating journey for me, so in the past I put spoiler warnings in this post and others like it – in case others, especially those with an interest in number theory, wanted to take a crack at independently solving things like generalized multiplication. I am now removing the spoiler warnings though; they did not prove to be constructive.
Before posting my ECMAScript regex, I thought it would be interesting to analyze Martin Ender's [.NET pure regex solution](https://codegolf.stackexchange.com/a/110732/17216), `^(?!(1(?<=(?=(?(\3+$)((?>\2?)\3)))^(1+)))*1$)`. It turns out to be very straightforward to understand that regex, and it is elegant in its simplicity. To demonstrate the contrast between our solutions, here is a commented and pretty-printed (but unmodified) version of his regex:
```
# For the purpose of these comments, the input number will be referred to as N.
^(?!                  # Attempt to add up all the divisors. Since this is a regex and we
                      # can only work within the available space of the input, that means
                      # if the sum of the divisors is greater than N, the attempt to add
                      # all the divisors will fail at some point, causing this negative
                      # lookahead to succeed, showing that N is an abundant number.
  (1                  # Cycle through all values of tail that are less than N, testing
                      # each one to see if it is a divisor of N.
    (?<=              # Temporarily go back to the start so we can directly operate both
                      # on N and the potential divisor. This requires variable-length
                      # lookbehind, a .NET feature – even though this special case of
                      # going back to the start, if done left-to-right, would actually be
                      # very easy to implement even in a regex flavour that has no
                      # lookbehind to begin with. But .NET evaluates lookbehinds right
                      # to left, so please read these comments in the order indicated,
                      # from [Step 1] to [Step 7]. The comment applying to entering the
                      # lookahead group, [Step 2], is shown on its closing parenthesis.
      (?=             # [Step 3] Since we're now in a lookahead, evaluation is left to
                      #          right.
        (?(\3+$)      # [Step 4] If \3 is a divisor of N, then...
          (           # [Step 5] Add it to \2, the running total sum of divisors:
                      #          \2 = \2 + \3         
            (?>\2?)   # [Step 6] Since \2 is a nested backref, it will fail to match on
                      #          the first iteration. The "?" accounts for this, making
                      #          it add zero to itself on the first iteration. This must
                      #          be done before adding \3, to ensure there is enough room
                      #          for the "?" not to cause the match to become zero-length
                      #          even if \2 has a value.
            \3        # [Step 7] Iff we run out of space here, i.e. iff the sum would
                      #          exceed N at this point, the match will fail, making the
                      #          negative lookahead succeed, showing that we have an
                      #          abundant number.
          )
        )
      )               # [Step 2] Enter a lookahead that is anchored to the start due to
                      #          having a "^" immediately to its right. The regex would
                      #          still work if the "^" were moved to the left of the
                      #          lookahead, but would be slightly slower, because the
                      #          engine would do some spurious matching before hitting
                      #          the "^" and backtracking.
      ^(1+)           # [Step 1] \3 = number to test for being a potential divisor – its
                      #               right-side-end is at the point where the lookbehind
                      #               started, and thus \3 cycles through all values from
                      #               1 to N-1.
    )
  )*1$                # Exclude N itself from being considered as a potential divisor,
                      # because if we included it, the test for proper abundance would be
                      # the sum of divisors exceeding 2*N. We don't have enough space for
                      # that, so instead what would happen if we did not exclude N as a
                      # divisor would be testing for "half-abundance", i.e. the sum of
                      # all divisors other than N exceeding N/2. By excluding N as a
                      # divisor we can let our threshold for abundance be the sum of
                      # divisors exceeding N.
)
```
[Try the .NET regex online](https://tio.run/##ZZBfa9swFMXf9ymUUMi98x/s9G2q4oHZQ6FlYynsYVlBc25TgSIbSc7UuP3smWK3fakwCHPO1f2d07isaS2djNyT62RDbP3kPO2H3imzY7WoW@NaTXz6v6Pg85@067W030JnyTkVDbzR0jm2H5yXXjXs0Kotu5XKMMDhIC1z4uv8dA/VDAJUVwKq@MHmMrlAgGq1WVa4uUTEewhJvD6HCzzN@XnQCkP/WNxIAVy@7v86byMIlKnLb8js/GO2xHTUv3f@zJLX7b5TmrbIJy/T/KG1oIxnRhQctKhjBLm9UYYAcSZMrzU3osRBPYBZFVjnv6zyNBlGjE7ofN1p5WGRLZCf31Ip8U9xoHvlWC2fn2dRyO/s0w9pHUH3u/iTtn204kfpbSwrJw/h21qYX5uD1LFBK82OvrCheJmnGjlpR2ObYSxlPTWxCItU4XvEY4yorgRxlSRpSESUMVLa/NrdSt88QsAx5/FDzqMo@TvCuDO8MiJ/Gc@pyMqiKP4D "C# (.NET Core) – Try It Online")
Now, back to my ECMAScript regex. First, here it is in raw, whitespace-and-comment-free format:
`^(?=(((?=(xx+?)\3+$)(x+)\4*(?=\4$))+(?!\3+$)(?=(xx(x*?))\5*$)x)(x+))(?=\1(x(x*))(?=\8*$)\6\9+$)(?=(.*)((?=\8*$)\5\9+$))(?=(x*?)(?=(x\11)+$)(?=\12\10|(x))(x(x*))(?=\15*$)(?=\11+$)\11\16+$)(?=(x(x*))(?=\17*$)\7\18+$)((?=(x*?(?=\17+$)(?=\17+?(?=((xx(x*))(?=\18+$)\22*$))(x+).*(?=\17$)\24*(?=\24$)(?!(xx+)\25*(?!\22+$)\25$)\22+$)((?=(x\7)+$)\15{2}\14|)))(?=.*(?=\24)x(x(x*))(?=\28*$)\23\29*$)(?=.*(x((?=\28*$)\22\29+$)))(.*(?!\30)\20|(?=.*?(?!x\20)(?=\30*$)(x(x*))(?=\33*$)(?=\31+$)\31\34+$).*(?=\33\21$)))+$`
(change `\14` to `\14?` for compatibility with PCRE, .NET, and practically every other regex flavour that's not ECMAScript)
[Try it online!](https://tio.run/##TVBNc9owEL33VwDDJLt2cSzZ5iOu8SmHXHJoj1U74wHFqHWER1YSNcBvp5IMgYu8fu/t2933p3qrupUSrZ50rVhz9bKVf/m/oyokfx985/WDaQE@iuVdcPwNZQHgHmPCElkSjhFMiCwNLMjSMWII5bDHvQpMUCKyLBij8VKHMwKO6Ou5pdiULU4tUYDwCWce7q2sj/8yQrDXMkIZifdgrOLiR9wsXxArsy8j0/M6F9HM2c8YmTvq5N8TZ@9ZWPprzVWXUzNKA7eTvSUKeqUD@wRo6rqHLh6LZYELg1LflfnWz3Fshn69bEcPjKR79COikwuaq2Wpz4ImjC7606zKwBVDLeNyQoj8xCS2oA3GKe0RQ2P/vFMSO4OLc5Kcskp8VglhSWqLfovEDiTONRwfg7sPjPT2h1ZC1oBR14gVh@nXSYqYd0Wcv29EwwGaQvFq3QjJAXFYyNemwV1dNFHXNkLD7eQWc/EMIIs6aris9QaXdL8X3VP1BKJoK9XxR6mh/hn/QjwT/JqQS1KSe0ej3qjt@@hRvlWNWA9UJWt@PxiFTf68VZCLbwXPRRiiHTgyo0jxllcaBEYvlV5tQCHuupub1p6kwV1B8vZVd1pZSX44HOMJncdfFsl8ssjofw "JavaScript (SpiderMonkey) – Try It Online")  
[Try it online!](https://tio.run/##TVFNc9owEL33VwDDJLt2cSwZ8xHXcMohlxzaY9XOeEAxah3jkZXEDfDb6UqCwGUtvff8dvfpT/FWtCutGjNqG7WW@mVb/5X/jjqv5XvvuywfugbgI1/cBcffsMwBbOm6cIkiCYcIXYhiHBAoxkPEEJZ9jzsVdMESUaTBEDsntbhgYAl/nhElJmJ@@iUKED7h1MHeinzcVzCGXisYFyzeQ0eKix@zvdyBkYyqYJPzOBfR1NpPBZtZ6uT/Sbh76IVWIDgLzjIxRWeb7vhBsPEe/Xh@VcQo8C5@BJ4GNg7OyCIlaO/C4jMn4jO3Wt9mSeDcS1PXb06UPzvluLuaPYnt7HwiEuZnpZ4dXDEpMTY2hMh5JpxAyskqacl@RzfvxK3BlfM5usQ@IFWRnKIjyqou0VETH00ypTcfHoO7D4zM9ofRqi4Bo7ZSKwmTr6MxYtbmcfa@UZUEqHIti3WlagmI/bx@rSrclXkVtU2lDNyObjFTzwB1XkaVrEuzwQXf71X7VDyByptCt/KxNlD@jH8hngl5TdQLtmT3lkaz0dv3wWP9VlRq3dNFXcr73iCssuethkx9y2WmwhCp4aAbRFo2sjCgMHopzGoDGnHX3tw0tJIBuwXLmlfTGk2S7HA4xqNpHH@ZJ/FoPon/Aw "JavaScript (SpiderMonkey) – Try It Online") (faster, 537 byte version of the regex)
And now a brief summary of the story behind it.
At first it was very non-obvious, to me at least, that it was even possible to match primes in the general case. And after solving that, the same applied to powers of 2. And then powers of composite numbers. And then perfect squares. And even after solving that, doing generalized multiplication seemed impossible at first.
In an ECMAScript loop, you can only keep track of one changing number; that number cannot exceed the input, and has to decrease at every step. My first working regex for matching correct multiplication statements A\*B=C was 913 bytes, and worked by factoring A, B, and C into their prime powers – for each prime factor, repeatedly divide the pair of prime power factors of A and C by their prime base until the one corresponding to A reaches 1; the one corresponding to C is then compared to the prime power factor of B. These two powers of the same prime were "multiplexed" into a single number by adding them together; this would always be unambiguously separable on each subsequent iteration of the loop, for the same reason that positional numeral systems work.
We got multiplication down to 50 bytes using a completely different algorithm (which teukon and I were able to arrive at independently, though it took him only a few hours and he went straight to it, whereas it took me a couple days even after it was brought to my attention that a short method existed): for A≥B, A\*B=C if and only if C is the smallest number which satisfies C≡0 mod A and C≡B mod A-1. (Conveniently, the exception of A=1 needs no special handling in regex, where 0%0=0 yields a match.) I just can't get over how neat it is that such an elegant way of doing multiplication exists in such a minimal regex flavour. (And the requirement of A≥B can be replaced with a requirement that A and B are prime powers of the same power. For the case of A≥B, this can be proven using the Chinese remainder theorem.) [See this post](https://codegolf.stackexchange.com/questions/179239/find-a-rocco-number/179420#179420) for a more in-depth explanation.
If it had turned out that there was no simpler algorithm for multiplication, the abundant number regex would probably be on the order of ten thousand bytes or so (even taking into account that I golfed the 913 byte algorithm down to 651 bytes). It does lots of multiplication and division, and ECMAScript regex has no subroutines.
I started working on the abundant number problem tangentially in 23 March 2014, by constructing a solution for what seemed at the time to be a sub-problem of this: Identifying the prime factor of highest multiplicity, so that it could be divided out of N at the start, leaving room to do some necessary calculations. At the time this seemed to be a promising route to take. (My initial solution ended up being quite large at 326 bytes, later golfed down to 185 bytes.) But the rest of the method teukon sketched would have been extremely complicated, so as it turned out, I took a rather different route. It proved to be sufficient to divide out the largest prime power factor of N corresponding to the largest prime factor on N; doing this for the prime of highest multiplicity would have added needless complexity and length to the regex.
What remained was treating the sum of divisors as a product of sums instead of a straight sum. As [explained by teukon](https://gist.github.com/Davidebyzero/9090628#gistcomment-1190698) on 14 March 2014:
> 
> We're given a number n = p0a0p1a1...pk-1ak-1. We want to handle the sum of the factors of n, which is (1 + p0 + p02 + ... + p0a0)(1 + p1 + p12 + ... + p1a1)...(1 + pk-1 + pk-12 + ... + pk-1ak-1).
> 
> 
> 
It blew my mind to see this. I had never thought of factoring the aliquot sum in that way, and it was this formula more than anything else that made the solvability of abundant number matching in ECMAScript regex look plausible.
In the end, instead of testing for a result of addition or multiplication exceeding N, or testing that such a result pre-divided by M exceeds N/M, I went with testing if a result of division is less than 1. I arrived at the first working version on 7 April 2014.
The full history of my golf optimizations of this regex is on github. At a certain point one optimization ended up making the regex much slower, so from that point on I maintained two versions. They are:
[regex for matching abundant numbers.txt](https://github.com/Davidebyzero/RegexGolf/blob/master/regex%20for%20matching%20abundant%20numbers.txt)  
[regex for matching abundant numbers - shortest.txt](https://github.com/Davidebyzero/RegexGolf/blob/master/regex%20for%20matching%20abundant%20numbers%20-%20shortest.txt)
These regexes are fully compatible with both ECMAScript and PCRE, but a recent optimization involved using a potentially non-participating capture group `\14`, so by dropping PCRE compatibility and changing `\14?` to `\14` they can both be reduced by 1 byte.
Here is the smallest version, with that optimization applied (making it ECMAScript-only), reformatted to fit in a StackExchange code block with (mostly) no horizontal scrolling needed:
```
# Match abundant numbers in the domain ^x*$ using only the ECMAScript subset of regex
# functionality. For the purposes of these comments, the input number = N.
^
# Capture the largest prime factor of N, and the largest power of that factor that is
# also a factor of N. Note that the algorithm used will fail if N itself is a prime
# power, but that's fine, because prime powers are never abundant.
(?=
  (                      # \1 = tool to make tail = Z-1
    (                    # Repeatedly divide current number by its smallest factor
      (?=(xx+?)\3+$)
      (x+)\4*(?=\4$)
    )+                   # A "+" is intentionally used instead of a "*", to fail if N
                         #  is prime. This saves the rest of the regex from having to
                         #  do needless work, because prime numbers are never abundant.
    (?!\3+$)             # Require that the last factor divided out is a different prime.
    (?=(xx(x*?))\5*$)    # \5 = the largest prime factor of N; \6 = \5-2
    x                    # An extra 1 so that the tool \1 can make tail = Z-1 instead of just Z
  )
  (x+)                   # Z = the largest power of \5 that is a factor of N; \7 = Z-1
)
# We want to capture Z + Z/\5 + Z/\5^2 + ... + \5^2 + \5 + 1 = (Z * \5 - 1) / (\5 - 1),
# but in case Z * \5 > N we need to calculate it as (Z - 1) / (\5 - 1) * \5 + 1.
# The following division will fail if Z == N, but that's fine, because no prime power is
# abundant.
(?=
  \1                     # tail = (Z - 1)
  (x(x*))                # \8   = (Z - 1) / (\5 - 1); \9 = \8-1
  # It is guaranteed that either \8 > \5-1 or \8 == 1, which allows the following
  # division-by-multiplication to work.
  (?=\8*$)
  \6\9+$
)
(?=
  (.*)                   # \10 = tool to compare against \11
  (                      # \11 = \8 * \5  =  (Z - 1) / (\5 - 1) * \5; later, \13 = \11+1
    (?=\8*$)
    \5\9+$
  )
)
# Calculate Q = \15{2} + Q_R = floor(2 * N / \13). Since we don't have space for 2*N, we
# need to calculate N / \13 first, including the fractional part (i.e. the remainder),
# and then multiply the result, including the fractional part, by 2.
(?=
  (x*?)(?=(x\11)+$)      # \12 = N % \13; \13 = \11 + 1
  (?=\12\10|(x))         # \14 = Q_R = floor(\12 * 2 / \13)
                         #     = +1 carry if \12 * 2 > \11, or NPCG otherwise
  (x(x*))                # \15 = N / \13; \16 = \15-1
  (?=\15*$)
  (?=\11+$)              # must match if \15 <  \13; otherwise doesn't matter
  \11\16+$               # must match if \15 >= \13; otherwise doesn't matter
)
# Calculate \17 = N / Z. The division by Z can be done quite simply, because the divisor
# is a prime power.
(?=
  (x(x*))                # \17 = N / Z; \18 = \17-1
  (?=\17*$)
  \7\18+$
)
# Seed a loop which will start with Q and divide it by (P^(K+1)-1)/(P-1) for every P^K
# that is a factor of \17. The state is encoded as \17 * P + R, where the initial value
# of R is Q, and P is the last prime factor of N to have been already processed.
#
# However, since the initial R would be larger than \17 (and for that matter there would
# be no room for any nonzero R since with the initial value of P, it is possible for
# \17 * P to equal N), treat it as a special case, and let the initial value of R be 0,
# signalling the first iteration to pretend R=Q. This way we can avoid having to divide Q
# and \17 again outside the loop.
#
# While we're at it, there's really no reason to do anything to seed this loop. To seed
# it with an initial value of P=\5, we'd have to do some multiplication. If we don't do
# anything to seed it, it will decode P=Z. That is wrong, but harmless, since the next
# lower prime that \17 is divisible by will still be the same, as \5 cannot be a factor
# of \17.
# Start the loop.
(
  (?=
    (                    # \20 = actual value of R
      x*?(?=\17+$)       # move forward by directly decoded value of R, which can be zero
      # The division by \17 can be done quite simply, because it is known that
      # the quotient is prime.
      (?=
        \17+?            # tail = \17 * (a prime which divides into \17)
        (?=
          (              # \21 = encoded value for next loop iteration
            (xx(x*))     # \22 = decoded value of next smaller P; \23 = (\22-1)-1
            (?=\18+$)    # iff \22 > \17, this can have a false positive, but never a false negative
            \22*$        # iff \22 < \17, this can have a false positive, but never a false negative
          )
        )
        # Find the largest power of \22 that is a factor of \17, while also asserting
        # that \22 is prime.
        (x+)             # \24 = the largest power of \22 that is a factor of \17
        .*(?=\17$)
        \24*(?=\24$)
        (?!
          (xx+)\25*
          (?!\22+$)
          \25$
        )
        \22+$
      )
      (
        (?=(x\7)+$)      # True iff this is the first iteration of the loop.
        \15{2}\14        # Potentially unset capture, and thus dependent on ECMAScript
                         # behavior. Change "\14" to "\14?" for compatibility with non-
                         # ECMAScript engines, so that it will act as an empty capture
                         # with engines in which unset backrefs always fail to match.
      |
      )
    )
  )
  # Calculate \30 = (\24 - 1) / (\22 - 1) * \22 + 1
  (?=
    .*(?=\24)x           # tail = \24 - 1
    (x(x*))              # \28 = (\24 - 1) / (\22 - 1); \29 = \28-1
    (?=\28*$)
    \23\29*$
  )
  (?=
    .*(x(                # \30 = 1 + \28 * \22 = (\28 - 1) / (\22 - 1) * \22 + 1; \31 = \30-1
      (?=\28*$)
      \22\29+$
    ))
  )
  # Calculate \33 = floor(\20 / \30)
  (
    .*(?!\30)\20         # if dividing \20 / \30 would result in a number less than 1,
                         # then N is abundant and we can exit the loop successfully
  |
    (?=
      .*?(?!x\20)(?=\30*$)
      (x(x*))            # \33 = \20 / \30; \34 = \33-1
      (?=\33*$)
      (?=\31+$)          # must match if \33 <  \30; otherwise doesn't matter
      \31\34+$           # must match if \33 >= \30; otherwise doesn't matter
    )
    # Encode the state for the next iteration of the loop, as \17 * \22 + \33
    .*(?=\33\21$)
  )
)+$
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~41~~ 40 bytes
```
n=k=j=input()
while~k<0:j-=1;k-=j>>n%j*n
```
Output is [via exit code](http://meta.codegolf.stackexchange.com/a/5330/12012), so **0** is truthy and **1** is falsy.
[Try it online!](https://tio.run/nexus/python2#PY1BDsIgFETXcIq/MbSNTcoWpXdB@lWg/hLAqBuvjujC3WTm5Y3dFgQNQohKOmivHcV76Xr@uLoV3@E4KT9qeQij9vNMOz9QbTDn5y1BwVysyQiOIBm6YCf3cpK94uynaeLV3E6LUX@Us5JebWf4RAu2vbcck6MCxFtpMZbvHE3O9QM "Python 2 – TIO Nexus")
### How it works
After setting all of **n**, **k**, and **j** to the input from STDIN, we enter the *while* loop. Said loop will break as soon as **-k - 1 = ~k ≥ 0**, i.e., **k ≤ -1** / **k < 0**.
In each iteration, we first decrement **j** to consider only proper divisors of **n**. If **j** is a divisor of **n**, `n%j` yields **0** and **j >> n%j\*n = j/20 = j** gets subtracted from **k**. However, if **j** does *not* divide **n**, `n%j` is positive, so `n%j*n` is at least **n > log2 j** and **j >> n%j\*n = j / 2n%j\*n = 0** is subtracted from **k**.
For abundant numbers, **k** will reach a negative value before or when **j** becomes **1**, since the sum of **n**'s proper divisors is strictly greater than **n**. In this case, we break out of the *while* loop and the program finishes normally.
However, if **n** is *not* abundant, **j** eventually reaches **0**. In this case, `n%j` throws a *ZeroDivisionError* and the program exits with an error.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 5 bytes
```
fk+>?
```
[Try it online!](https://tio.run/nexus/brachylog2#@5@WrW1n//@/oYHBfwA "Brachylog – TIO Nexus")
### Explanation
```
f           Factors
 k          Knife: remove the last one (the input itself)
  +         Sum
   >?       Stricly greater than the Input
```
[Answer]
## Mathematica, 17 bytes
```
Tr@Divisors@#>2#&
```
## Explanation
```
Tr@                 The sum of the main diagonal of
   Divisors@         the list of divisors of
            #         the first argument
             >      is greater than
              2#      twice the first argument.
                &   End of function.
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
Æṣ>
```
[Try it online!](https://tio.run/nexus/jelly#@3@47eHOxXb/DQ0MFA63KxyekKYQqfBwx/ZHDXMU3DJzSlKLFBJzchQK8oszSzLLUhUy80pS01OLihVKCxRK8hVA2pIqFUoyUhUSk/KB8jmZedkKiXkpCgVFqSUllUAKqEPvPwA "Jelly – TIO Nexus")
### How it works
```
Æṣ>  Main link. Argument: n
Æs   Get the proper divisor sum of n.
  >  Test if the result is greater than n.
```
[Answer]
# [Python](https://docs.python.org), 44 bytes
```
lambda n:sum(i*(n%i<1)for i in range(1,n))>n
```
**[Try it online!](https://tio.run/nexus/python3#TclBDkBADAXQq3QjacXCbAUXwWKEShPzyeD8FTtv@7QbfY9pXiKhuZ7EVjIKa4PokcnIQDliWzlUEOnhZzbcPIC@x@/rIGRKypBJ/AU)**
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~5~~ 4 bytes
-1 bytes thanks to [scottinet](https://codegolf.stackexchange.com/users/73296/scottinet)
```
Ñ¨O‹
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8MRDK/wfNez8/9/SDAA "05AB1E – Try It Online") or [Try 0 to 100](https://tio.run/##MzBNTDJM/W9oYODm5/f/8MRDK/wfNez876d0eL@VgpK9zn8A "05AB1E – Try It Online")
[Answer]
## [Retina](https://github.com/m-ender/retina), ~~50~~ 45 bytes
```
^(?!(1(?<=(?=(?(\3+$)((?>\2?)\3)))^(1+)))*1$)
```
Input in [unary](http://meta.codegolf.stackexchange.com/questions/5343/can-numeric-input-output-be-in-unary), output `1` for abundant numbers, `0` otherwise.
There is nothing Retina-specific about this solution. The above is a pure .NET regex which matches only abundant numbers.
[Try it online!](https://tio.run/nexus/retina#FZBJSgRREET37xZCC1X25uecCWotvUQjLrz/FdovBMQqxsfvndvb8@vn@7heDjmu94/j2jgedr@dx3F9PvQ6H3ae5/ch901vcjufrz/yFBTDCZKiGWQhgihiiCOBJFJII4MudGsUNdTRQBMttNHBFibYtjTMscASK6yxwRcuuOI70fHAEy@88SEWIYQSRuxCQSRRRBNDLlJIJY10cvdNssgmh1qUUEoZ5VRQe05RTQ29aKGVNtrpoJPea5seZjHCKGOMM8EkU8w@4/@N9Qc "Retina – TIO Nexus") (Test suite that filters decimal input with the above regex.)
[Answer]
## [Retina](https://github.com/m-ender/retina), 34 bytes
Byte count assumes ISO 8859-1 encoding.
```
M!&`(1+)$(?<=^\1+)
1>`¶
^(1+)¶1\1
```
Input in [unary](http://meta.codegolf.stackexchange.com/questions/5343/can-numeric-input-output-be-in-unary), output `1` for abundant numbers, `0` otherwise.
[Try it online!](https://tio.run/nexus/retina#FZC5aQNQEETz14VBNrKV/L13wUcF7kAIBa5RBagx@SsbBuZ8PV7PfycOH4/fl7frUU7vh@PP59flvBHyfb3f4PKk7zc5y@MhKIYTJEUzyEIEUcQQRwJJpJBGBl3o1ihqqKOBJlpoo4MtTLBtaZhjgSVWWGODL1xwxXei44EnXnjjQyxCCCWM2IWCSKKIJoZcpJBKGunk7ptkkU0OtSihlDLKqaD2nKKaGnrRQitttNNBJ73XNj3MYoRRxhhngkmmmH3G8431Dw "Retina – TIO Nexus")
### Explanation
```
M!&`(1+)$(?<=^\1+)
```
We start by getting all divisors of the input. To do this, we return (`!`) all *overlapping* (`&`) matches (`M`) of the regex `(1+)$(?<=^\1+)`. The regex matches some suffix of the input, provided that the entire input is a multiple of that suffix (which we ensure by trying to reach the beginning fo the string using only copies of the suffix). Due to the way the regex engine looks for matches, this will result a list of divisors in descending order (separated by linefeeds).
```
1>`¶
```
The stage itself simply matches linefeeds (`¶`) and removes them. However, the `1>` is a limit, which skips the first match. So this effectively adds together all divisors except the input itself. We end up with the input on the first line and the sum of all proper divisors on the second line.
```
^(1+)¶1\1
```
Finally, we try to match the at least one more `1` on the second line than we have on the first line. If that's the case, the sum of proper divisors exceeds the input. Retina counts the number of matches of this regex, which will be `1` for abundant numbers and `0` otherwise.
[Answer]
# x86 machine code, 25 bytes
```
00000000: 8bc8 d1e9 33db 33d2 50f7 f158 85d2 7502  ....3.3.P..X..u.
00000010: 03d9 7204 e2f0 3bc3 c3                   ..r...;..
```
Listing:
```
8B C8       MOV  CX, AX         ; counter starts at N / 2
D1 E9       SHR  CX, 1          ; divide by 2 
33 DB       XOR  BX, BX         ; clear BX (running sum of factors)
    DIV_LOOP:
33 D2       XOR  DX, DX         ; clear DX (high word for dividend) 
50          PUSH AX             ; save original dividend 
F7 F1       DIV  CX             ; DX = DX:AX MOD CX, AX = DX:AX / CX 
58          POP  AX             ; restore dividend (AX was changed by DIV) 
85 D2       TEST DX, DX         ; if remainder (DX) = 0, CX is a divisor 
75 02       JNZ  CONT_LOOP      ; if not, continue loop to next 
03 D9       ADD  BX, CX         ; add number to sum 
    CONT_LOOP:
72 04       JC   END_ABUND      ; if CF=1, BX has unsigned overflow it is abundant
E2 F0       LOOP DIV_LOOP 
3B C3       CMP  AX, BX         ; BX<=AX -> CF=0 (non-abund), BX>AX -> CF=1 (abund) 
    END_ABUND:
C3          RET                 ; return to caller
```
Callable function, input `N` in `AX`. Output `CF`=`1` if abundant, `CF`=`0` if not abundant.
[Try it online!](https://tio.run/##hVRrb9owFP2Mf8VVvxQkUBMo7Zq1lYB06qYWqvUxtGlCTmLAU2Kj2AG6P8@unYQmZdOQiOA@zjn3FaoUS4L4tTOnKtnNZZpQDTd3n4BtWZhpGsQMeoTMlKap9kgjkWsARrdt6BKuZjTIRESF9nbwj89HGEyBK4j4mkdMRMQY7ycvAKNp2/jeAkOZCc1SsFwKUMgYTpDHeB9vv@YZbhU6B4XgtYiaTjBqiFHDGm7MaGpMzTQTgosFqCwBOYc5DbVMVYv4n19md5PJg/eG4iOKf4iCpuaSL5awkWkE2K99YS2b@/D8eFutKs9VdM1ApnzBBY3rrUBqU9i7BKS5woeHSPcTv2xVaTpBQ842eYBDtpQpLIvteaCJIRuqIFxSsWCR6RfS5oKfbh6fDovlc0RJKBcRzqPpT1vI7bSB6wJUAVszEb@CkkY8zpdaj5KpRf0y/o5VTcZPtq0VVCF1GwctNBcZg1jKFWgJgm21zRv4fj7AUVUNjSIQWRKgFgzG4eUcI3zcjP3ZYPg89isco09Xrl2BJdacCcUXAouWa5bOY7kxRRi9xeZCc7NkwvBdwlm/3ztrkb3ufB3Mr29Qrog1je5t39/t2XB6eYWd7lwbBQ40hRQdS9Mygdd7lwvN3Ez26r1d45cIwbRnf1OkscrU0hwbIQ1cPry7iLfhh2CbmAvWcX@W5xjiObqkoXRUWgJjcUjEQp7QeGb6jMe7xXVFEPThgzRwYDYUHeFykV@1dZh@A43bcOwcG1ipAtLgRh9SHURrXLfiL0rFOn4DVInL1IiTUp6VYKDe9Bt3VXz1VXNqIDSAs/3gIMYKl8ZyVbvlkZLHiAiTVZHrOo6DogIGUHlf1SK6fRtCMWSFK8Nm3Sp57i4cXj3x/H/Y3b77DrtXe4dad@Hw6om9v2KXQ8Qe2clVdNaaVJwLRAEcnXYvTi/OzrsX/SNSLI@xO9tBG7@7Pw)
Props:
* Fixed for 16-bit overflow (+5 bytes). Thanks @deadcode for the suggestions!
* Simplified return logic (-3 bytes). Thx to help from @deadcode once again.
* Use TEST instead of CMP (-1 byte). Thx to @l4m2, and make sure to [upvote @l4m2's shorter x86 answer](https://codegolf.stackexchange.com/a/179303/84624)!
* Thx to @deadcode for the TIO link
[Answer]
# [Actually](https://github.com/Mego/Seriously), 5 bytes
```
;÷Σ½>
```
[Try it online!](https://tio.run/nexus/actually#@299ePu5xYf22v3/b2oCAA "Actually – TIO Nexus")
```
;     # Duplicate input
 ÷    # Get divisors
  Σ   # Sum
   ½  # Divide by 2 (float)
    > # Test is greater than input
```
[Answer]
**Java 8, 53 bytes ( a lot more if you include the ceremonial code )**
```
return IntStream.range(1,n).filter(e->n%e<1).sum()>n;
```
[Try it online](https://tio.run/nexus/java-openjdk#ZY@/a8MwEIX/lVsCUmlEvdol0KFDh04ZQ4azc3WvSCcjnQwh@M/O7Cr019D5Pb7vPQ5TTAofOKMryt5lTYTB3XUwld7zAIPHnOEVWS4wJZ5RCbKi1qiP0RMKcH7qi5xQ1LAoiL3AmkhLEngR3X8RE8pIprkX697YKyVD251s6LGxLpdg7E66dfmxfhvmyCcI1W0qhWU8HAHTmKvgP7h5aH7Rt7lt@7erBjE94/Bu9uesFFws2rb1jqgX2y3LepW4HWqBPgE)
Explanation : 
```
IntStream.range(1,n) \\ numbers from 1 to n-1
filter(e->n%e<1)     \\ filter in numbers that perfectly divide the number n
sum()>n              \\ sum and compare to original number
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
Ñ¨O‹
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8MRDK/wfNez8/9/SEgA "05AB1E – Try It Online")
# How it works
```
Ñ        #list of divisors
 ¨       #remove last element (i.e the input from the list of factors)
  O      #sum the list 
   ‹     #is this sum less than the input? 
```
Sorry to post in old question, I was just going through old posts for practise and noticed my solution was shorter than the next best 05AB1E solution.
[Answer]
# [Julia](https://julialang.org), 25 bytes
```
a(n,r=1:n)=(n.%r.<1)'r>2n
```
[Attempt This Online!](https://ato.pxeger.com/run?1=LY5BCsMgEEX33qKLUgUraoyaUHuRkIVZFFKKFImn6cZNDtGj5Db9YBfyPv-Nw3z2Z3mtsR5LXIqSMkxEaU6U50RLPMNJB3aWEwMaOAPXo-_RWXQWdKCDc3Ae2cN75AF5gMdmMu9le1z9N9LEc1BjYoEmcc7iptgl33Vq_ji985o2StWIX2yK4p_mENqNrA3W2vgD)
[Answer]
# Regex (Perl/PCRE+`(?^=)`[RME](https://github.com/Davidebyzero/RegexMathEngine)), 36 bytes
```
(?=((\2x+?|^x)(?^=\2+$))+)(\2x+)\3+$
```
[Try it on replit.com](https://replit.com/@Davidebyzero/regex-Abundant-numbers-with-lookinto) (RegexMathEngine)
Takes its input in unary, as the length of a string of `x`s.
This is based on my 43 byte .NET version; for the full explanation, see below. Lookinto, a new feature in RegexMathEngine, allows `(?<=(?=\2+$)^.*)` to be shortened to the equivalent `(?^=\2+$)`.
This is not just the shortest, but the fastest under RegexMathEngine, even though the 43 byte .NET regex it's based on is the slowest under .NET (beaten by both 44 byte regexes in speed).
# Regex (Java / .NET) / [Retina](https://github.com/m-ender/retina), 43 bytes
```
(?=((\2x+?|^x)(?<=(?=\2+$)^.*))+)(\2x+)\3+$
```
[Try it online!](https://tio.run/##bVLvb9owEP3ev@IWdcIm4AamfZkboW3apEnrNpWPQCWTOODWcTLbKYGufzs7h@xHJfLlcnfP7/ye7148ivF9/nBUZV1ZD/eYM1WxIYf/K41X@mzNyo1ssXNRN2utMsi0cA5uhDLwBH3NeeExPFYqhxI7ZO6tMhsQduMWKwp@a6udg09tJmuvKjx5AfBZaQlFauSu@yURy6pcMuxHlH9oikJamd9KkUsL6w72skj@nOzTglLez3Ujz3fbwE@IS9eoQeRflZGE0lepabSmqiCOyZ@N0I5EV8PhMKL06SX0xECIP0vwhAz@LwMSXCHDGnEP3MXpYGkGIXr@fKo9/xDeS2vApv0fqi3rMMBRjm6sq0pLYeCQFsgoOcwzYQxKV6ZuPKQQ1PY1Mt87L0umDOXQ6@xgbCvcN9l6vGZnMUBviMa7I8cJZBDRS@z7ixVobAcUc7VWnkRjfATEezAJdr4Yj2tgWS2sk5gQvUhWdARmcrbJtDQbv72ewgwCEt5hmKyQMdsKu1i1vZ4uM5MVh/fWir1jhdKatKNBO@hMASgqG7ThNVKTcDDXqZlgiGMUeCN8tkWHSmSzrDxlpNtcgwv@EclPG8N2VtSkH5FV9f57cSvMRuKkZGQoDUoLICWONzl6F972QHuTK3RsZ5WXJDwq5YfU2ya8z792jR76gkSvXYSWUP4cvouwVUcySwlZTtt49uuupWR2nWJlOY0v6R0bUhrTrkmXb@LLY1iiYzKevk1@Aw "Java (JDK) – Try It Online") - Java (very slow)  
[Try it online!](https://tio.run/##RY/RaoQwEEV/RWTAzKaRaN/WBhf63C9QF8TOroE0kZhF2a3fbnVL6eM5c7ncGdxEfuzJmBW8qjxdaW6OR0sTOyUrKxVjdT7z8vs8Iyvf1GbqnAOe0wMix@cR61cOa3J6id/d16ANfcZYwF3J4uI8tV3PwETaRqDtcAv4gFaBEeNgdIhFXOgLgzbt3M0GYUKU7wGuoK1ks2wFDKyqtA3N0xRghaE/znbmHB97h08/2tD1NLJkTg5g8Vff8TF5HUj0bgzLNisr/jkS1m2/Gm0pArssyypFJqX8AQ "PowerShell – Try It Online") - Regex (.NET)  
[Try it online!](https://tio.run/##HckxCsMwDADAXb8IyCBZONhJMxQSPPYTwqjQDl06lA4a8q4@oB9zQ9e71/39eF5L15tAdJBgjTxy0uICWL4fxwyBLHmETnUj0sml7s2Z6rodopMgtzEyC/@TdRbsmAdgGxvAxQYI5j2neclwPi0/ "Retina – Try It Online") - Retina
This is 2 bytes shorter than [Martin Ender's answer](https://codegolf.stackexchange.com/a/110732/17216). Its structure is quite different, and it's more portable to different regex engines.
It works by first adding up as many proper divisors of N as it can, in strict order from smallest to largest, while having a sum not greater than N. Then it checks if there exists a larger proper divisor than the last one added to the sum; if there does, N is an abundant number.
```
# For the purpose of these comments, the input number will be referred to as N.
                      # No anchor needed, because \2 cannot be captured if
                      # matching is started anywhere besides the beginning.
(?=
    (                 # Add up all values of \2 until there is no more room in
                      # N to keep going
        (\2x+?|^x)    # \2 = the smallest value greater than the previous value
                      # of \2 which satisfies the following condition; if we're
                      # at the beginning, \2 = 1
        (?<=          # Lookbehind - evaluated from right to left
            (?=\2+$)  # Assert that N is divisible by \2
            ^.*       # Jump to the beginning of the input string, then execute
                      # the above lookahead
        )
    )+
)
(\2x+)                # Match if there exists another proper divisor of N, \3,
\3+$                  # such that \3 is greater than the last value of \2. If
                      # there does, that means there was insufficient room in N
                      # to add up all of its proper divisors, and N is abundant.
```
# Regex (Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) / .NET) / [Retina](https://github.com/m-ender/retina), 47 bytes
```
(?=((\3x+?|^x)(?<=(?=\2+$)^.*(\2)))+)(\2x+)\4+$
```
**[Try it online!](https://tio.run/##LY7BjsIwDETv/Qor4mCTtkqAU7tRP4SChCBApJBWSQ6h2n/vJiwn2zPzRp7f8Tm5/Wpe8@QjhHeovX7o1INXnjG24qAQx33iw@85EQ4/Kivjjm/o3G5x3BERpzwTp/HAN2tmjrJr5KmHRYnqPnmwYFxpbkO8GddVYJVtw2xNRNYwqqCEXAn5i3toNC6iPYoT1f9bLiMuKYNg7vB5rw364q9P9DWwxLbuYxZ36WD2BaMiLEr239vV2t0UY7SKRgoh/gA "Python 3 – Try It Online") - Python `import regex`**  
[Try it online!](https://tio.run/##RY/RaoQwEEV/RWTAzKaRaPdpbXChz/0CdUG22RpIJxKzKGv9dqstpU/DOVwud3o3aj902toVvKq8/tBTczqRHtk5WVmpGKufJ15@XSZk5YvaTJ1zwEt6YHWOiBy3O3GsjxzW5PwUv7rP3lj9HmMBDyWLm/O6vXYMbGQoAkP9PeAMrQIrht6aEIu4MDcGbXp1dwrChijfA1xBW8lm2QoYkKoMhebHFEDC6j/OduYc573Dp29tuHZ6YMmUHIDwVz9wHr0JWnRuCMs2Kyv@ORLktn@tIR0BLcuySpFJKb8B "PowerShell – Try It Online") - .NET  
[Try it online!](https://tio.run/##Dcg7CsMwDADQXbcIyCBZONj5DIUEj72EMCq0Q5cOpYOGnqsH6MWcTA/e@/F5vm6l610gOkiwRh45aXEBLP@fY4ZAljxCp7oT6exSv82Z6rafo5MgtzGSTswsfOrCugh2zAOwjQ3gagME857TvGa4LOsB "Retina – Try It Online") - Retina
This is a port of the 43 byte Java/.NET version, avoiding a nested backreference in order to add Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) support. The way in which this is done (placing the copy inside the lookbehind) removes Java support.
# Regex (Perl / [PCRE2](https://www.pcre.org/) v10.35+), 49 bytes
This is a direct port of the .NET regex, emulating variable-length lookbehind using a recursive subroutine call.
```
(?=((\2x+?|^x)((?<=(?=^\2+$|(?3)).)))+)(\2x+)\4+$
```
[Try it online!](https://tio.run/##RY5BT8MwDIX/ijVFa6y0NC1wIcnaSePKiRvdooFWKVLYSlKkoqz89ZKVSbtYfs/P9tcdnH2cPn@AOAHBnj72FkguolRys35dr0ZoT44Sr7iQK4EBTBsVhs6ZYw@L5rgQI9RW@c6aniZZkvrvd9/HFZ1mRVrg4esSqm4ujz4@EY3icsvHj3tXW1liqO1bsVWx8q24/jVXSYxU8zh2jGEwLVCaDAkMEEOIoH4hJy7HQPxyOcPNbBG8EP@sxIhxHLV@ftloPdFKUdqUA6vOuwEpraSK1q4pGTnT6h7xDhEZzhFsHhiZJp4VnPM/ "Perl 5 – Try It Online") - Perl (slow)  
[Attempt This Online!](https://ato.pxeger.com/run?1=XVDBSsNAEMVrv2IJC5kxSZtUD8JmyUWFgnhQb027xLhpAukmJCkE2n6JF0H0n_RrnKQ9edjdNzPvzZvZ9886rz9-L1ZhRIDxhklmzSw2ZXWjN6rRdZmkGuzZ9DJSKk_KTqXVti5K3cQQo4ifZq3tMptORkm10QPBdNp0LSh1v3i4UwpdFiC1pMZiklUN8EL6gpcyI3oLzy-3i0cUuGdFBrxctl1TakMIvWAlpRUbC4nc7l6pQmnXd70AB73u67J602B5lkt0Qfq02plu0IZzEi2pAd3-SkwYG53NOeYmlGOdkOMgWTMYV94mXZoDb1wyG_bXSQd2b7vcICLbDyMWqNO8GuYSjFYJBBtixo04ks3x3z8Biq9dl3k3PwFEEiCe9050WPcIEIWSUut47vADRFeIU_JwcKRgfO3wk_Dj_Hz7XuD7_in6Aw) - PCRE2 v10.40+
```
(?=
    (
        (\2x+?|^x)
        ((?<=          # (?3) calls this
            (?=        # Circumvent the constant-width limitation of lookbehinds
                       # in PCRE by using a lookahead inside the lookbehind
                ^\2+$  # This is the payload of the emulated variable-length
                       # lookbehind, same as the one in the .NET regex
            |
                (?3)   # Recursive call - this is the only alternative that can
                       # match until we reach the beginning of the string
            )
            .          # Go back one character at a time, trying the above
                       # lookahead for a match each time
        ))
    )+
)
(\2x+)
\4+$
```
# Regex (Java / Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) / .NET) / [Retina](https://github.com/m-ender/retina), 50 bytes
```
(?=((?=(\3|^))(\2x+?)(?<=(?=\3+$)^.*))+)(\3x+)\4+$
```
[Try it online!](https://tio.run/##bVJdb9MwFH3vr7hEQ7Wb1usHvOBFFSCQkBig7bHtJDdxWm@OE2xnzVr628t1Gj4mLVJk33uuz/U5vvfiUYzus4eTKqrSerjHmKmSDTj8n6m90i/mrNzIBpFeVa@1SiHVwjm4FsrAAbqc88Lj8liqDApEyK23ymxA2I1brCj4rS13Dj41qay8KvFkD@Cz0hLyxMhduyURS8tMMsQjyj/UeS6tzG6kyKSFdVv2PEn@nOzCnFLe9XVDz3fbwE@IS9aoQWRflZGE0leJqbWmKieOyZ@10I5El4PBIKL08Lz0zECIf5HggAz@LwMSXCLDGuseuIuT/tL0w@r58Zw7/hDeS2vAJt0O1RZVaOAoRzfWZamlMLBPcmSUHG5TYQxKV6aqPSQQ1HY5cvvkvCyYMpRDp7MtY1vhvsnG4zVbiwE6QzTeHTnORQYrOokdvliBRjhUMVdp5Uk0wkfAeg9mjMgX43EMLKuEdRIDohfjFR2CmbwIMi3Nxm@vpjCHUAnvcJmskDHdCrtYNZ2eNjKTFYf31oonx3KlNWmG/abfmgKQlzZow2skZszBXCVmgksco8Br4dMtOlQgm2XFOSLt5Boc8I9Ifp4YtrOiIl2LtKyevuc3wmwkdhoPDaVBaQ6kwPYmQ@/C2@5pZ3KJju2s8pKER6V8n3hbh/f5B1fooc9J9NpFaAnlx/D1wlSdyDwh4V/Oft1RSpbTJp5TMr9KMLmcxRf0jg0ojRGZNTFdvokvTmGWTuPR9O34Nw "Java (JDK) – Try It Online") - Java (very slow)  
[Try it online!](https://tio.run/##LY7BysIwEITvfYoleMiatiR/PbWGPohVkN@ogZiWTQ61@O41UQ8Lu/PNDDs94330zWof00gRwjOUZG5m7oA0McZW3mueZ2heJ0Q@/M2iR97vdRKHRmzwVG8RRSLNLHDYic2aYgfVVurYwaJlcR0JHFify@sQL9a3BTjt6jA5GzmrGBaQTT6b6OxvhlsfuTvII5bfLZWhUJiCYK/w@bAO5kz/d04lsJlt/QdmurQwUY5hFhatut/tS@MvmjFcZaWklG8 "Python 3 – Try It Online") - Python `import regex`  
[Try it online!](https://tio.run/##RY/RaoQwEEV/RWTAzKaRuNuntcGFPvcL1AWx2RpIJxKzKGv9dqstpQ/zcM4dLjO9G7UfOm3tCl6VXn/oqT6fSY/skqysUGyf6vR1RWTVceIFsuJFbbI6ccBrekDkW3KaOFbPHNbk8hS/us/eWP0eYw4PJfOb87ppOwY2MhSBof4ecIZGgRVDb02IRZybG4Mmbd2dgrAhOu4LXEFTynrZChiQKg2F@sfkQMLqP8525hznvcOnb01oOz2wZEoOQPirHziP3gQtOjeEZTsry/85EuS2l60hHQEty7JKkUkpvwE "PowerShell – Try It Online") - .NET
This is a port of the 43 byte Java/.NET version, avoiding a nested backreference in order to add Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) support, while keeping Java support.
# Regex (Perl / [PCRE](https://www.pcre.org/)), 58 bytes
Porting the PCRE2 regex to PCRE1 requires working around some bugs:
```
(?=((?=(\3|^))(\2x+?)((?<=(?=z|^\3+$|(?4)).)))+)(\3x+)\5+$
```
The `(\2x+?|^x)` had to be changed to `(?=(\3|^))(\2x+?)`, copying `\3` into `\2` and `\2` into `\3` (emulating a nested backref using a forward backref), because using a backreference inside its own group forces that group to be atomic in PCRE1, and in PCRE2 up to v10.34. And a fake always-false alternative `z` had to be added to the recursive subroutine to prevent the error message "recursive call could loop indefinitely" in PCRE1.
[Try it online!](https://tio.run/##RU7BboMwDP0Vq4pKrMAIZb0spFCpu@6022ijbipSpKxlCZPYUvbrLLBKO9jye372e@3JmvX4/gXECvDm8nY0QFIRoCx22@ftZoDmYilxkotiI9CDbgJC31p97mBRnxdigMpI1xrd0SiJYvf56rpwouIkizM8fUyi8p/lgccHolBMv1xwPNrKFCv0lXnJ9jJ0vhc3X32DRBdyXoeJMfS6AUqjPoIegggR5A@kxKboiVsu53BzthA8E39ZiRbDMCj1@LRTaqSlpFPV@fWASOtVz0oMTCED@3091DkjV1reI94hIguKvGdYrxkZR55knPNf "Perl 5 – Try It Online") - Perl (slow)  
**[Try it online!](https://tio.run/##hVPvb9owEP3OX3FlbbGbUCUNq2hCirqu0z6wdkJU2gQ0YsEBa8GJnDBoC//62DmGNv0hLQLJPj@/e/fuHKZpfRKGmw9chPF8zKCVhpIdT88r4XQkIUj7Q/ChW/20WPz@5cx/3t//6E1PF1OyIW2fqP/AWd1RSgYnS6NNMdLyMfqwuhs4xv6KtBuUHlNKDUQ4S4MOPhr7G/qarWrCUeoHqWF7lWclWT7miZJSDkkuJi9jPMEoG83e4s4rXOSQ4jIPmJSJJGEishyK0o5mLMtGE0YfMY/rhgiAVgu2UbUs4kyMYw8ky@dSgO2tC8rZiAtC4bEC@KV9zBYzQVJat4e@5cEcMc5JkEOidurCBBcFuODU6vAgneceKMPhSDIPyupQTppLfVuybB7neq3qiKKM5SYk8xzTTvKpPkn@sDBPZN8Z6lTI6hfkQZjMUh4zkprw/bJ7FXy@6V10OrDSu9vel6YJhzqhXuwyWFRT8QjInmR050NUeBoRrAbRJlQVUSFNwgiVFNfhYOzCQTYQ2N0Sp86zJY7wAlHiH5RThTkTlsdcMKK7woWpfaIeYuyd54UovCYsrHGUJ5wUoOMwQG8JpSYI24Q0yfBYn0RcjEmtXtsmVp@wlUGI2fPLfXFdoYLtd3jBKPAGoBAXkz9z6aapdIIt9K4vbMMeejhRMyycZCbUljUlDEvJ8HDol@4/GcF9oWam5QvbA8Pg5Yp1V9Us7DrLliwkkplwfdvpmIA5OHat@G3HwQSnVPKumVuWcx8sWK12pOhDMRFX3e5NN7i@@XbRu/z6WsCO4oECOqMqJbWBqOn@eG@guo04qupFce9dqm36Foo5PPyPmBd8VReu1NBVX/Ku33esZLdGrCvFyLp6FCVjqIQ@Pfbtq6usN1a9cWpVmo5VbzaalbMTq37WaP4No3g0yTb1WHXiHw "C++ (gcc) – Try It Online") - PCRE1  
[Try it online!](https://tio.run/##fVFNT8MwDL3vV1hRpMa03VoGp6zqBZAmIQ7AjUJUSrYGujRKM2mC8duHO7jAgYMtf7zn5ziudYdF6VoH3EMBbMZgCs7rtfLadXWjRTSbnpRKtXUXVNNvnOm0r0SFsrqdDVECEdmKimqtR4AN2oZBKHW1vL5UChPIkUbSYDkx1qhBB8Fc4/X0uW7egienOrMxgSXA0pyhhN8wr5utH0xv/4e9frcy6kxWvRfcFJnkXbGitQZxd3@xvEGJH2BWgncPQ/CdthRhmj8WBassQwIP22fqUDnJkjTHka93rutftGApSwguid/0WxtG7uKUSA80gHz2KCcAR2X7k3O7KI59iuIYSRrE8bSbOjSt4D4hsfHOug4i2kUJt4gIH@OKBnXT9uNeEugpuYQxB27lJ8l8/vkPgfIgykKMVs33T4iiOt3FJVJlUVD1ff9UzWO@F@UZ4pRUYkLMdzFW5zE/HLI0z7LsCw "PHP – Try It Online") - PCRE2 v10.33**  
[Attempt This Online!](https://ato.pxeger.com/run?1=XVBfS8MwEMfXfYpQAs3Zdms3BTEtfVFhID6ob8sWak3XQpeWNoPh5ifxZSD6nfTTeNn25MMld5ffn7t8fLZlu_89m8cpJoR2JCHOyCFD0nZqKTvV1lmumDsanqdSllltZN6s2qpWnWACuHgc9a5PXIwCm3KpLEAbpU3PpLyb3t9KCT6JACVRmA-KpmO0SkJO66RAeM-enm-mD8BhS6qC0XrWm65WGjMIonmSOEI7gOB-_YIv2PZDP4jA8tWmrZtXxZzA8RHOkZ83a20sNx4jaYYCeIZzPiDk4KxPNdVxcnjHzPMArQk7rLzKTF4y2vloZvdXmWHuxvWpBgCytSNWoPKysXNxgqtEnNiaUM3f0eb93z8x4F9rUwRXP9csTZgNMdktAJgYb7wUsBMn2H3bLcTEozuWXgAM0cxDxGTjgbj06FFhf7q-wyAKw_BY_QE) - PCRE2 v10.40+
---
# Regex (.NET) / [Retina](https://github.com/m-ender/retina), 44 bytes
```
^(?!((?<=(?=(?(\3+$)((?>\2?)\3)))(^x*))x)*$)
```
[Try it online!](https://tio.run/##RY/RaoQwFER/xcoFc7VZ4u7b2tSFPvcL1AWxd2sgTSRmUVb8dhtbSmFezjAMM4OdyI09ab2Bk5WjT5qb89nQxC7JdmXlE2Pli2RlEKtPGWDg1/pYYn1CRHadU8QZU8AtuTzHb/ZrUJo@YizgIUVxs47armegI2UiUGa4e1yglaD5OGjlYx4X6sagPXT2bjzXPjrugUxCW4lmDQUMjKyU8c2PU4Dhmv443znLcNk73OG99V1PI0vmJAWDv/YDl8kpT7y3o1/DrLz454gbG85qZSgCs67rJnguhPgG "PowerShell – Try It Online") - Regex (.NET)  
[Try it online!](https://tio.run/##DcsxCkIxEEXR/u0iMIGZhEhi/IWgpnQTIYyghY2FWMzKXIAbi4HbnOK@H5/n61Zmv0cEQ/Q62IKkXiyCyu9rlOFZkwXMwc0xt9OZ24p7jSTLl75v0quI8FivmASSSdlBdDeAqzp4tZlT3TKOh@0P "Retina – Try It Online") - Retina
```
^(?!(x(?=(x*$)(?<=(?(^\2+)(\2(?>\3?))))))*$)
```
[Try it online!](https://tio.run/##RY9Ra4QwEIT/ipUFN2dzRPt2Ns1Bn/sL1AOxezWQJhJzKCf@dqtXSuftm1mGnd6N5IeOjFnBy9LTF0316WRpxHOyXlA94YRK4nQAhupVosJLlacMqxzVW/Wi2ENbuibn5/jdfffa0GfMCrhLUVydp6btEEykbQTa9rfAZmgkGD70RoeYx4W@IjTH1t1s4CZE@X6QSmhKUS9bAYKVpbahfjgFWG7oj7Od05TNe4c/fjSh7WjAZEoOYNmvfWfz6HUg3rkhLNtbWfHPEbduG2u0pQjssiyr4JkQ4gc "PowerShell – Try It Online") - Regex (.NET)  
[Try it online!](https://tio.run/##HcoxCgIxEEbh/r9FIIGZhEiy6xaC65ReIoQRtLCxkC3mZB7Ai8XF137v/dier1sd7Z4QDSloJ4ucW7UEX78f8wWBNFvE6CSOjGTdF88k55WEepsSU5tILm0W/rfr8MWB9dCBqzoEtVHyvBScjssP "Retina – Try It Online") - Retina
This is based on [Martin Ender's answer](https://codegolf.stackexchange.com/a/110732/17216), but saving 1 byte by testing zero as a potential divisor of \$n\$ (it never will be, so this is harmless), thus skipping the need to explicitly exclude \$n\$ itself as a divisor. Another upshot of this is that we can extend the valid domain from `^\x+$` to `^\x*$`, giving the correct answer (non-match, i.e. false) for an input of zero.
I have included versions with both smallest-to-largest and largest-to-smallest divisor summing order. The length for both is 44 bytes. Only the largest-to-smallest version is commented below, because it's simpler to explain, and I already commented the original 45 byte smallest-to-largest version [in my ECMAScript answer](https://codegolf.stackexchange.com/a/178952/17216).
```
^(?!                  # Attempt to add up all the divisors. Since this is a regex and we
                      # can only work within the available space of the input, that means
                      # if the sum of the divisors is greater than N, the attempt to add
                      # all the divisors will fail at some point, causing this negative
                      # lookahead to succeed, showing that N is an abundant number.
  (x                  # Cycle through all positive values of tail that are less than N,
                      # testing each one to see if it is a divisor of N. Start at N-1.
    (?=               # Do the below operations in a lookahead, so that upon popping back
                      # out of it our position will remaing the same as it is here.
      (x*$)           # \2 = tail, a potential divisor; go to end to that the following
                      # lookbehind can operate on N as a whole.
      (?<=            # Switch to right-to-left evaluation so that we can operate both
                      # on N and the potential divisor \2. This requires variable-length
                      # lookbehind, a .NET feature. Please read these comments in the
                      # order indicated, from [Step 1] to [Step 4].
        (?(^\2+)      # [Step 1] If \2 is a divisor of N, then...
          (           # [Step 2] Add it to \3, the running total sum of divisors:
                      #          \3 = \3 + \2
            \2        # [Step 4] Iff we run out of space here, i.e. iff the sum would
                      #          exceed N at this point, the match will fail, making the
                      #          negative lookahead succeed, showing that we have an
                      #          abundant number.
            (?>\3?)   # [Step 3] Since \3 is a nested backref, it will fail to match on
                      #          the first iteration. The "?" accounts for this, making
                      #          it add zero to itself on the first iteration. This must
                      #          be done before adding \2, to ensure there is enough room
                      #          for the "?" not to cause the match to become zero-length
                      #          even if \3 has a value.
          )
        )
      )
    )
  )*                  # By using "*" instead of "+" here, we can avoid categorizing zero
                      # as an abundant number.
  $                   # We can only reach this point if all proper divisors of N, all the
                      # way down to \2 = 1, been successfully summed into \3, which would
                      # mean N is not an abundant number.
)
```
As far as speed goes, the smallest-to-largest version is faster than the largest-to-smallest version (both in .NET and their ports below). Both are faster than the 43 byte version under .NET.
## Regex (Perl/PCRE+`(?^=)`[RME](https://github.com/Davidebyzero/RegexMathEngine)), 42 bytes
```
^(?!(x(?=(x*))(?^=(?(?=\2+$)(\3?+\2))))*$)
```
[Try it on replit.com](https://replit.com/@Davidebyzero/regex-Abundant-numbers-with-lookinto-43-bytes) (RegexMathEngine)
This is a port of the largest-to-smallest 44 byte .NET regex, using lookinto instead of variable-length lookbehind. Although the Perl/PCRE syntax for lookahead conditionals is more verbose, this is compensated for by being able to use a possessive quantifier.
## Regex (Perl/PCRE+`(?^=)`[RME](https://github.com/Davidebyzero/RegexMathEngine)), 44 bytes
```
^(?!((?^0=(x*))(?^=(?(?=\2+$)(\3?+\2)))x)*$)
```
[Try it on replit.com](https://replit.com/@Davidebyzero/regex-Abundant-numbers-with-lookinto-44-bytes) (RegexMathEngine)
This is a port of the smallest-to-largest 44 byte .NET regex, again using lookinto instead of variable-length lookbehind. This one is less conducive to being ported, and I had to use `(?^0=)`, lookinto accessing the in-progress current match. I've not decided how to finalize the current behavior of this, so it's likely this version will not work with a future version of lookinto.
## Regex (PCRE2), 73 bytes
This is a direct port of the 44 byte .NET regex (based on Martin Ender's regex). It doesn't port well to PCRE, because it changes the value of a capture group inside the lookbehind – but upon the return of any subroutine in PCRE, all capture groups are reset to the values they had upon entering the subroutine. So the only way to port it is to change the main loop [from iteration into recursion](https://chat.stackexchange.com/transcript/message/49026684#49026684), resulting in a large and very slow regex:
```
^(?!(x(?=(x*$)((?<=(?=^(?(?=\2+$)(?=(\4?+\2))).*(?=\2$)(?1)|(?3)).)))|$))
```
[Try it online!](https://tio.run/##fVNhb9owEP3Or7hGUWO3gQJFVbsQIW2jE9PWVinbF@isEAzxGpzIMR1T6W9nL@naaV01JCz73bt353tOkRa7/qBIC3INheQcOdSiwsilMLLI4kQy76h1MBAijTMrknxVqEyaKZvyYBodlZ5PHv4LgGIpK4K2UtuSCXE@@jQUgvvU4ZCEcNBY/DDKSnY9fj@MIt@5ehcNu3Tn8ODvAERKG2vLvIohvg6j69Hlhcdf8pypRm5DaSVKaZlTJEa2ZnFyaw0WkamVso5PTrPzL83IZG1Klev/074/htpVZJEb5qqwHbhZuMBly6qP0QUP@D2pBXOzSWlNJjV2vNm5CcO6P5DL9QwRwH7bb3Z4lS83RZbPJXOajg96gPwkX@PKOPS7SJpAAGv7JmgQ1ZX177Or@2Edx@7wkNM9CIQGiO0x9zasvVvFNkmZa3zUrYyUMYa58XxXc/zIlY@0LC6tkMZAngfPMu4tbbfg7IXhVTT8IC4uBaZ9GaFUdU3FZZLm1d0Cwjg6AVVncnXw8KcTaOzvv6pRk7035LUmeDneCO/F6Dijug0Ab5/8o9oYkps0XpdWzhGLnkx7JfY5zjCmlZzTl/F585SSNIYKxEufirws1Sz7SUonuYH1FnuJ/bxOHaeS8sUCrtNczUnnlmpaWeR6TjYnC8JMLpXWSi9BpZju4kw9l4IOaihtIfZxNCa83lf6v5m4srbzofHw4nvC@Hff2GCPbdggZJsDlzM26Ic4AMU67R4CQmjaGxxOu/CwdVDDFdrhWzY4BgR463K@27Wb3Xa7cXp80jjr9ZpnvZNf "PHP – Try It Online") - PCRE2 v10.33 (PHP)  
[Try it on regex101](https://regex101.com/r/HZiNAS/3) - PCRE2 v10.38+  
[Attempt This Online!](https://ato.pxeger.com/run?1=fVJNj9MwEJU49le4lrWx26RNCgeEa-UAZVUJtass4rJZrGxw2tDUiRwXKm174HfsZaUVPwp-DeOUD7FIRIoz896bNx47dw_Nurn__uTLNIYAEYMEwmOMRqgxaiWNaqosV9QbjwaxlOussjKvt01ZKZPSlPE0Gbeejzx4CwDlSjmBtkrblkr5ev5mJiXzUcTAEox5r_hsSqvo5dtXsyTx8cXLZDZBnzDjfxNg0tpMW-o5hXw3Sy7ny4XHGO-VupStshQ3uVGjmyzfWAOLrMptabGPcBDhf2RG5TvTlrX-v-zjiQodU9SGklKEnFSigMFat7f5gnF2i8qCkuqqtaZSGiIWRNdC4FRjBuJ2dwMMwH7oBxFz9WrfVPUHRXGAfZBzqM_rHYwHyXQCRVdgAGt4zXsIdZ31z5zoqeh4iIZDhm5BgGADiPYp2YjunraZzdeUGB_6uktTGRzc3vOJZvAgok6yKmutVMaAPesLcZHMzuViKeG8lwn_bUs26HCAGmjlxiyZyte1m40jOI6II5cjovnxz06g5uysq-lI_ALh0aOWctuuKHNtjr3jo38J8K87WwTPv83f07hP9zQWdD8gjNJ4KiABFNZ0MgQIqPRZPEwnMNpo0MEOjdiBxk8BAvhAGDsZ3v_6hMEkDE_JDw) - PCRE2 v10.40+ (PHP)  
[Attempt This Online!](https://ato.pxeger.com/run?1=hVVfb9pIEH-7Bz7FxK3CLpgcJm0VYRyUSzgFKQ2V66i9Ame5Zg3WmbVlr5U0JZ_kXu6lj_1AvU9z410bTKh0Fpid38zOn9_MLn9_95Moz4qvu_T971OtEyV-ynqdM23-w36xYEHIGby7tEc993JyNXLvbseO-2F85VzDWeNFyP0oXzAYyE0nq_OGv_JScJPpHCywtd_u7__6fJr_8eXLR2f15n5FvuUi6Jz9GP9JhkfkgQwt8tB6SQkZDiwUEMX3rNdGCFWzV8P2rEcpPWlJuEANuiHDU4QQ3rykVDn89xeHPo-l6dBKLDdpG2Yt0UwswrhItA6lIV_uY2GMKPPWh3bnjZALSHApXJamcUr8mGcCZOGtNcsyb8noV4zT7_toAIMBlGixlDjji8iElIk85WCYTwcuC9mPF0yHz3EcQWwFXpQxCl8bgI8MVfqc9l6_mZsSDgMgsg_ukpWO3NKKKGdENfLu8vrCPmvRUqlDFj6yOCBV8vBrhdTskW8ZpXhIDENViR_nAvqwrZYWNWpyG8gM-qA9Y0Bu1jTcpc24RlXuWy4aioy1F3JS1ZtMkfqIcZLQjjG3uibkaHPacwUyg1KxYYkLaSxTUa1CRZILExQpBQXQSlklrz3hr9yFJzxs23atvKUsyyOhqxLMcv7fjz-NJBIEGUMllo5JLcWqKgFHvgq1TsKIkZK_9-8cmyZ66ebTyJ64zsh-O769cEZXFXw1cS5ubmBTinfO7zocy_jlbxm1S3fdPkqxWSV19fGR79KuVqZ1ULmLsieYG6Tx2k08IVjKSYoTcXt3c1M6COIU5EA-FlxLenG-IrwXiGp7yHXFNDXRxqi6JpPEbbyLgT0Rh0QanfgudodQqgM3dEjiDNVKg3fNgjQ7zTJw8XCjyBptjqx6Z_t9XoDDn_iFtrRvAybSx-A7X-qEFuE4u1fSlBttY27ieK6RXJLp0HxoFolhKRkq51Zt_5aI0OLF1A0sbpjQbof1itUkFNOzT7dktT4PGCvEbsrPriF7zG9ZxFaXPs8t6MJmU4VAVpTLkW1PbPd28vbCubx-nk_l45ECElUUTpoz3lTtMg9MdwcbT2t4qK-lM8Bsjo__N5s9jxoefHNvXKvTJtKcUbwN68Gefs5srS3K4qmhrht1YTwf8yBljOxkWr8TlBJP0vZGVlHwKlJ_Lv9863Z63a4S_gM) - PCRE2 v10.40+ (C++)
[Answer]
# [PARI/GP](http://pari.math.u-bordeaux.fr/), 15 bytes
```
n->sigma(n)>2*n
```
The variant `n->sigma(n,-1)>2` is, unfortunately, longer.
[Answer]
# Powershell, ~~51~~ 49 Bytes
```
param($i)((1..$i|?{!($i%$_)})-join"+"|iex)-gt2*$i
```
I wish I could remove some brackets.
-2 thanks to AdmBorkBork, instead of not counting the input in the initial range, we just take it into account in the final check.
Loop through range of `1..` to the `$i`nput, minus 1, find where (`?`) the inverse modulo of input by the current number is `$true` (aka only 0) - then `-join` all of those numbers together with `+` and `iex` the resulting string to calculate it, then see if the sum of these parts is greater than the input.
```
PS C:\++> 1..100 | ? {.\abundance.ps1 $_}
12
18
20
24
30
36
40
42
48
54
56
60
66
70
72
78
80
84
88
90
96
100
```
[Answer]
# [k](https://en.wikipedia.org/wiki/K_(programming_language)), ~~19 16~~ 15 bytes
```
{x<+/&~(!x)!'x}
```
Returns `1` for true, and `0` for false.
[Try it online!](https://tio.run/##y9bNz/7/P82qusJGW1@tTkOxQlNRvaL2v4aioYGBpoNamjqI8R8A "K (oK) – Try It Online")
```
{             } /function(x)
       (!x)     /{0, 1, ..., x-1}
            '   /for each n in {0, 1, ..., x-1}:
           ! x  /    do (x mod n)
      ~         /for each, turn 0 -> 1, * -> 0 (map not)
     &          /get indices of 1's
   +/           /sum (fold add)
 x<             /check if x < the sum
```
[Answer]
# MATL, 6 bytes
```
Z\sGE>
```
Outputs 1 for abundant numbers, 0 otherwise.
## How it works
```
Z\      % list the divisors of the implicit input
s       % add them
G       % push the input again
E       % double it
>       % compare
        % implicitly display result
```
[Answer]
## [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), 22 bytes
```
:[a/2|~a%b|\p=p+b}?p>a
```
This is an adaptation to the [QBIC primality test](https://codegolf.stackexchange.com/questions/57617/is-this-number-a-prime/105049#105049). Instead of counting the divisors and checking if it's less than three, this sums the proper divisors. This runs only along half of `1 to n`, where the primality test runs through `1 to n` completely.
Explanation:
```
:       Get the input number, 'a'
[a/2|   FOR(b=1, b<=(a/2), b++)
~a%b    IF a MOD b != 0  --> QBasic registers a clean division  (0) as false. 
        The IF-branch ('|') therefor is empty, the code is in the ELSE branch ('\')
|\p=p+b THEN add b to runnning total p
}       Close all language constructs: IF/END IF, FOR/NEXT
?p>a    Print '-1' for abundant numbers, 0 otherwise.
```
[Answer]
# JavaScript (ES6), 33 bytes
```
let g =
x=>(f=n=>--n&&n*!(x%n)+f(n))(x)>x
```
```
<input type=number min=1 value=1 step=1 oninput="O.innerHTML=g(+value)"><br>
<pre id=O>false</pre>
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 9 7 6 bytes
```
<Uâ1 x
```
Saved 2 bytes thanks to ETHproductions. Saved 1 byte thanks to obarakon.
[Try it online!](https://tio.run/nexus/japt#@28TeniRoULF//@GRgA "Japt – TIO Nexus")
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), 38 bytes
```
/..?%?(O;0I:^.<.>;rrw+s;rUO?-<...O0L.@
```
[Try it here](https://ethproductions.github.io/cubix/?code=ICAgICAgLyAuIC4KICAgICAgPyAlID8KICAgICAgKCBPIDsKMCBJIDogXiAuIDwgLiA+IDsgciByIHcKKyBzIDsgciBVIE8gPyAtIDwgLiAuIC4KTyAwIEwgLiBAIC4gLiAuIC4gLiAuIC4KICAgICAgLiAuIC4KICAgICAgLiAuIC4KICAgICAgLiAuIC4K&input=MTIK&speed=25)
```
      / . .
      ? % ?
      ( O ;
0 I : ^ . < . > ; r r w
+ s ; r U O ? - < . . .
O 0 L . @ . . . . . . .
      . . .
      . . .
      . . .
```
`0I:` - sets up the stack with 0, n, n (s, n, d)  
`^` - start of the loop
`)?` - decrement d and test for 0. 0 exits loop   
`%?` - mod against n and test. 0 causes `;rrw+s;rU` which rotates s to top and adds d, rotates s to bottom and rejoins loop  
`;<` - Cleanup and rejoin the loop.  
On exiting loop  
`;<` - Remove d from stack and redirect  
`-?` - Remove n from s and test, 0 `LOU@` turns left, outputs and exits, negatives `0O@` push zero, output and exits. positives `;O` remove difference and outputs n. The path then goes through to the left turn which redirects to the `@` exit
[Answer]
# Pure Bash, 37 bytes
```
for((;k++<$1;s+=$1%k?0:k)){((s>$1));}
```
*Thanks to @Dennis for rearranging the code -- saving 6 bytes and eliminating the incidental output to stderr.*
The input is passed as an argument.
The output is returned in the exit code: 0 for abundant, 1 for not abundant.
Output to stderr should be ignored.
Test runs:
```
for n in {1..100}; do if ./abundant "$n"; then echo $n; fi; done 2>/dev/null
12
18
20
24
30
36
40
42
48
54
56
60
66
70
72
78
80
84
88
90
96
100
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 11 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
-2 bytes thanks to @Adám
```
⊢<1⊥∘⍸0=⍳|⊢
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91LbIxfNS19FHHjEe9OwxsH/VurgGK/U8Dyj7q7YMo7Go@tN74UdtEIC84yBlIhnh4Bv9PUzAy4EpTMLTkAupMO7QCqNXQwBAA "APL (Dyalog Unicode) – Try It Online")
Explanation:
```
⊢<1⊥∘⍸0=⍳|⊢ ⍝ Monadic function train
        ⍳   ⍝ Generate integers from 1 to input
        |⊢ ⍝ For each of the above, modulo the input    
      0=   ⍝ Return a boolean vector where ones correspond
           ⍝ to zeroes
     ⍸      ⍝ Return the indices of the ones in the above vector
           ⍝ This results in a vector of the proper divisors of our input
  1⊥∘      ⍝ Composed with the above, decode into unary base.
           ⍝ This has the same effect as summing the vector, but is used
           ⍝ here to comply with the function train format.
⊢<         ⍝ Is the above sum greater than our input?
```
[Answer]
# [Arn](https://github.com/ZippyMagician/Arn), [12 bytes](https://github.com/ZippyMagician/Arn/wiki/Carn)
```
Ý░™€ºa^¬"/”&
```
[Try it!](https://zippymagician.github.io/Arn?code=PCgrXCR2eyEldn0xLT4=&input=MwoxMgoxOAoxOQoyMAoyNAoyOQozMA==)
# Explained
Unpacked: `<(+\$v{!%v}1->`
```
  _                    Variable initialized to STDIN; implied
<                      Is less than
  (                    Begin expression
      \                Fold with
    +                  Addition
        $              Filtered list
          v{           Block with key of v
            !          Boolean not
                _      Implied
              %        Modulo
                v
           }           End of block
             1         Literal one
           ->          Exclusive range
             _         Implied
  )                    End of expression, implied
```
I should probably add a builtin fix for getting factors...
[Answer]
# [RProgN](https://github.com/TehFlaminTaco/Reverse-Programmer-Notation), 8 Bytes
```
~_]k+2/<
```
## Explained
```
~_]k+2/<
~           # Zero Space Segment
 _          # Convert the input to an integer
  ]         # Duplicate the input on the stack
   k+       # Get the sum of the divisors of the top of the stack
     2/     # Divded by 2
       <    # Is the Input less than the sum of its divisors/2.
```
[Try it online!](https://tio.run/nexus/rprogn#@18XH5utbaRv8///fzMA "RProgN – TIO Nexus")
[Answer]
## Batch, 84 bytes
```
@set/ak=%1*2
@for /l %%j in (1,1,%1)do @set/ak-=%%j*!(%1%%%%j)
@cmd/cset/a"%k%>>31
```
Outputs `-1` for an abundant number, `0` otherwise. Works by subtracting all the factors from `2n` and then shifting the result 31 places to extract the sign bit. Alternative formulation, also 84 bytes:
```
@set k=%1
@for /l %%j in (1,1,%1)do @set/ak-=%%j*!(%1%%%%j)
@if %k% lss -%1 echo 1
```
Outputs `1` for an abundant number. Works by subtracting all the factors from `n` and then comparing the result to to `-n`. (`set/a` is Batch's only way of doing arithmetic so I can't easily adjust the loop.)
[Answer]
# Perl 6, ~~72~~ 24 bytes
```
{$_ <sum grep $_%%*,^$_}
```
* Program argument: a.
* Generate a list from `1..a`.
* Take all the numbers that are divisors of `a`.
* Sum them.
* Check if that sum is greater than `a`.
Thanks to @b2gills.
[Answer]
# J, 19 bytes
Thanks to Conor O'Brien for cutting it to 19 bytes!
`<[:+/i.#~i.e.]%2+i.`
Previous: (34 bytes)
`f=:3 :'(+/((i.y)e.y%2+i.y)#i.y)>y'`
Returns 1 if it's abundant and 0 if it's not.
**Output:**
```
   f 3
0
   f 12
1
   f 11
0
   f 20
1
```
]