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
- perfect (OEIS A000396), if the sum of proper divisors of N equals N. The sequence begins with 6, 28, 496, 8128, 33550336, 8589869056, 137438691328, 2305843008139952128...
- refactorable (OEIS 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...
- practical (OEIS 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...
- highly composite (OEIS A002128), 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). 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
AC
is the program that recognizes perfect numbers.AD
is the program that recognizes refactorable numbers.BC
is the program that recognizes practical numbers.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 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.