Number Theory/Relative To Record

In a fluctuating integer sequence, every term has a relative-to-record score, defined by the following formula:

"Relative to Record" = $$ \frac{S(x)}{(S(m)+S(x))} $$

where S(x) is the observed term of the sequence, and S(m) is the maximum value of S(k) for the range 1 ≤ k ≤ x − 1.

The inverse value is defined by subtracting this value from one.

Both "Relative to Record" and "Relative to Record (Inverse)" are real numbers between 0 and 1. "Relative to Record" is greater than 0.5 if and only if S(x) is a record term in the sequence. "Relative to Record (Inverse)" is less than 0.5 if and only if S(x) is a record term in the sequence. A term S(x) is a record term iff for all positive integers k such that k < x, S(k) < S(x). By convention:


 * The first term of any integer sequence is considered to be a record term.
 * Terms that tie, but don't break, a record are not considered to be record terms.

An integer sequence S(x) is a fluctuating integer sequence iff it is neither "eventually strictly increasing" nor "eventually strictly decreasing." Equivalently:


 * I) There are infinitely many natural numbers n such that S(n + 1) > S(n).
 * II) There are infinitely many natural numbers n such that S(n + 1) < S(n).

In number theory, two important fluctuating integer sequences are the divisor function d(n) and the prime gaps. For any natural number n, d(n) is the number of positive divisors of n. For example, d(15) = 4 because fifteen has four divisors: 1, 3, 5, and 15. The prime gaps, as the name suggests, are the arithmetic differences between consecutive prime numbers. There are 25 prime numbers between 1 and 100, those being 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97. To find a prime gap, you subtract a prime from its successor; for example, to find the eighth prime gap, subtract the eighth and ninth primes: 23 − 19 = 4. The first 24 prime gaps are:

1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8.

The records in this sequence are g(1) = 1, g(2) = 2, g(4) = 4, g(9) = 6, and g(24) = 8. The next time the record breaks is the thirtieth term: g(30) = 127 − 113 = 14. After that, you won't find a larger term until the ninety-ninth term: g(99) = 541 − 523 = 18. The record breaks yet again at g(154) = 907 − 887 = 20. Due to the prime number theorem, prime gaps grow arbitrarily large, so this record will keep being broken.

Relative to Record (Divisor function)
Numbers for which d(n) sets a new record are called . The highly composite numbers below 1000 are:

1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, and 840.

For all n > 1, d(n) is always at least two. Those numbers with exactly two divisors are the prime numbers.