[Question]
  [
## Four integer sequences
In this challenge, you will test four different properties of a positive integer, given by the following sequences.
A positive integer **N** is
1. *perfect* ([OEIS A000396](https://oeis.org/A000396)), if the sum of proper divisors of **N** equals **N**. The sequence begins with 6, 28, 496, 8128, 33550336, 8589869056, 137438691328, 2305843008139952128...
2. *refactorable* ([OEIS A033950](https://oeis.org/A033950)), if the number of divisors of **N** is a divisor of **N**. The sequence begins with 1, 2, 8, 9, 12, 18, 24, 36, 40, 56, 60, 72, 80, 84, 88, 96, 104, 108, 128...
3. *practical* ([OEIS A005153](https://oeis.org/A005153)), if every integer **1 ≤ K ≤ N** is a sum of some distinct divisors of **N**. The sequence begins with 1, 2, 4, 6, 8, 12, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42, 48, 54, 56...
4. *highly composite* ([OEIS A002128](https://oeis.org/A002182)), if every number **1 ≤ K < N** has strictly fewer divisors than **N**. The sequence begins with 1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840, 1260, 1680, 2520, 5040...
## Four programs
Your task is to write four programs (meaning full programs, function definitions or anonymous functions that perform I/O by any of the [standard methods](https://codegolf.meta.stackexchange.com/q/2447/32014)).
Each program shall solve the membership problem of one of these sequences.
In other words, each program will take a positive integer **N ≥ 1** as input, and output a truthy value if **N** is in the sequence, and a falsy value if not.
You can assume that **N** is within the bounds of the standard integer type of your programming language.
The programs must be related in the following way.
There are four strings `ABCD` such that
1. `AC` is the program that recognizes perfect numbers.
2. `AD` is the program that recognizes refactorable numbers.
3. `BC` is the program that recognizes practical numbers.
4. `BD` is the program that recognizes highly composite numbers.
## Scoring
Your score is the total length (in bytes) of the strings `ABCD`, or in other words, the total byte count of the four programs divided by two.
The lowest score in each programming language is the winner.
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply.
For example, if the four strings are `a{`, `b{n`, `+n}` and `=n}?`, then the four programs are `a{+n}`, `a{=n}?`, `b{n+n}` and `b{n=n}?`, and the score is 2+3+3+4=12.
  
[Answer]
## JavaScript (ES6), 46 + 55 + 6 + 36 = ~~282~~ ~~274~~ ... ~~158~~ 143 bytes
A:
```
n=>(r=0,D=x=>x&&D(x-1,n%x||(r++?q-=x:q=n)))(n)
```
B:
```
n=>(q=(g=D=x=>x&&!(n%x||(g|=m>2*(m=x),0))+D(x-1))(m=n))
```
C:
```
?!g:!q
```
D:
```
?(P=k=>--k?D(n=k)<q&P(k):1)(n):n%r<1
```
The result is 4 anonymous functions which give truthy/falsy values for their respective inputs (`AC`, `AD`, and `BC` give `true`/`false`, `BD` gives `1`/`0`).
### Test snippet
```
let AC =
n=>(r=0,D=x=>x&&D(x-1,n%x||(r++?q-=x:q=n)))(n)
?!g:!q
let AD =
n=>(r=0,D=x=>x&&D(x-1,n%x||(r++?q-=x:q=n)))(n)
?(P=k=>--k?D(n=k)<q&P(k):1)(n):n%r<1
let BC =
n=>(q=(g=D=x=>x&&!(n%x||(g|=m>2*(m=x),0))+D(x-1))(m=n))
?!g:!q
let BD =
n=>(q=(g=D=x=>x&&!(n%x||(g|=m>2*(m=x),0))+D(x-1))(m=n))
?(P=k=>--k?D(n=k)<q&P(k):1)(n):n%r<1
let update = n => O.innerText = [
  'perfect: ' + AC(n),
  'refactorable: ' + AD(n),
  'practical: ' + BC(n),
  'highly composite: ' + BD(n)
].join("\n")
```
```
<input type=number value=1 min=1 oninput=update(this.value)>
<pre id=O></pre>
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 + 17 + ~~2~~ 1 + 2 = ~~29~~ 28 bytes
A:
```
Æṣ⁼$Ædḍ$
```
B:
```
ÆDŒPS€QṢwRµṖÆdṀ<Ʋ
```
C:
```
ƭ
```
D:
```
0?
```
For practical numbers (BC), `0` is falsy and any other result is truthy.
AC and BC are full programs, since they're not reusable as functions.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 + 16 + 1 + 0 = 25 bytes
A: `Ñ¨O©QI®Ö`  
B: `ÑæOILåPILÑ€gRć‹P`  
C: `s`  
D: 
The long parts each calculate both values, `s` swaps to the first one.
```
Ñ          # push list of divisors
 ©         # store this list
  ¨        # remove the last (largest) value
   O       # take the sum
    Q      # is this equal to the input (perfect)
     I     # push the input
      ®    # push the stored divisor list
       g   # take the length
        Ö  # does it divide the input? (refactorable)
        (s)# (swap to perfect)
```
[Try *perfect* online!](https://tio.run/##yy9OTMpM/f//8MRDKw@t8A/0PLQu/fC04v//DS0A "05AB1E – Try It Online") or [Try *refactorable* online!](https://tio.run/##yy9OTMpM/f//8MRDKw@t8A/0PLQu/fC0//8NLQA "05AB1E – Try It Online")
```
ÑæOILåP    # practical?
Ñ          # push list of divisors
 æ         # take the powerset
  O        # sum of each subset
   IL      # push the range [1..input]
     å     # is each value in the sums of divisor-subsets?
      P    # take the product / boolean all
ILÑ€gRć‹P  # highly composite?
IL         # push the range [1..input]
  Ñ        # take the divisors of each integer
   €g      # take the length of each divisor list
     R     # reverse it (swap the input's to the front)
      ć    # push the first value seperately
       ‹   # is this larger
        P  # than all other values?
(s)        # (swap to practical)
```
[Try *practical* online!](https://tio.run/##yy9OTMpM/f//8MTDy/w9fQ4vDQASEx81rUkPOtL@qGFnQPH//4YWAA "05AB1E – Try It Online") or [Try *highly composite* online](https://tio.run/##yy9OTMpM/f//8MTDy/w9fQ4vDQASEx81rUkPOtL@qGFnwP//hhYA "05AB1E – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 + 17 + 3 + 3 = 28 bytes
There's already a 28-byte Jelly answer, but I have a different approach, so why not add it too?
## Parts
The pilcrow `¶` represents a newline.
A: `S=¶ḍ¶` (5 bytes)  
B: `ŒP§iⱮḶ}Ạ¶>ḶÆd$}Ạ¶` (17 bytes)  
C: `ÆḌñ` (3 bytes)  
D: `Ædç` (3 bytes)
## Perfect (8 bytes)
```
S=
ḍ
ÆḌñ
```
[Try it online!](https://tio.run/##y0rNyan8/z/Yluvhjl6uw20Pd/Qc3vj//38zAA "Jelly – Try It Online")
### Explanation
```
S=   Auxiliary dyadic link
S    Sum of items in left argument
 =   Equals right argument?
ḍ   Ignored
ÆḌñ   Main monadic link
ÆḌ    Proper divisors
  ñ   Apply next link, with the number as right argument
```
## Refactorable (8 bytes)
```
S=
ḍ
Ædç
```
[Try it online!](https://tio.run/##y0rNyan8/z/Yluvhjl6uw20ph5f////fyAIA "Jelly – Try It Online")
### Explanation
```
S=   Ignored
ḍ   Auxiliary dyadic link: Divides?
Ædç   Main monadic link
Æd    Number of divisors
  ç   Apply previous link, with the number as right argument
```
## Practical (20 bytes)
```
ŒP§iⱮḶ}Ạ
>ḶÆd$}Ạ
ÆḌñ
```
[Try it online!](https://tio.run/##y0rNyan8///opIBDyzMfbVz3cMe22oe7FnDZARmH21JUwJzDbQ939Bze@P//f3MA "Jelly – Try It Online")
### Explanation
```
ŒP§iⱮḶ}Ạ   Auxiliary dyadic link
ŒP         Power set
  §        Sum of each
   iⱮ      Find index of each item from
     Ḷ}      Lowered range [0..(right argument - 1)]
       Ạ   All?
>ḶÆd$}Ạ   Ignored
ÆḌñ   Main monadic link
ÆḌ    Proper divisors
  ñ   Apply next link, with the number as right argument
```
## Highly composite (20 bytes)
```
ŒP§iⱮḶ}Ạ
>ḶÆd$}Ạ
Ædç
```
[Try it online!](https://tio.run/##y0rNyan8///opIBDyzMfbVz3cMe22oe7FnDZARmH21JUwBwg4/Dy////WwAA "Jelly – Try It Online")
### Explanation
```
ŒP§iⱮḶ}Ạ   Ignored
>ḶÆd$}Ạ   Auxiliary dyadic link
>         Greater than?
    $     (
 Ḷ   }      Lowered range [0..(right argument - 1)]
  Æd        Number of divisors [of each]
    $     )
      Ạ   All?
Ædç   Main monadic link
Æd    Number of divisors
  ç   Apply previous link, with the number as right argument
```
[Answer]
# [Haskell](https://www.haskell.org/), 69 + 133 + 3 + 3 = score 208
A:
```
d n=filter((<1).mod n)[1..n]
f n=[sum(d n)-n==n,length(d n)`elem`d n]
```
B:
```
import Data.List
d n=filter((<1).mod n)[1..n]
f n=[all(\n->any(==n)$sum$subsequences$d n)[1..n],all((<length(d n)).length.d)[1..n-1]]
```
C:
```
!!0
```
D:
```
!!1
```
[Try it online!](https://tio.run/##rU@7DsIwDNzzFanUIZWaiDBWFAnoyB9AJQJNISIxpQkDQnx7cal4jAwMlnxn@@58UP6ore1unM4yUlHIa2ODbhmbyES4EzLJSgoBJalxuPIXx3qOQ55DajXsw@FJbLTVboNdSfidENSbZ8S45tQGWqigxNL48IOBspatgU8VXBlaJDE6Ym29Pl807LSPPxdpv8wmXykSMQBRDStclu88i4xE0eiFih5JRN1fnkblzikDNKdNayDQmNZUjrsH "Haskell – Try It Online")
Yeah, it's pretty cheap but I'm not smart enough for a cooler solution. :P
]