login
Iteration numbers k for which MD5^k(128 bits 1) yields record lows.
4

%I #26 Mar 11 2026 23:58:51

%S 0,1,5,7,42,147,176,3536,5866,8099,38939,41788,822951,2971632,6665500,

%T 240068069,516948648,8535635266,21058720638,46951859987,68385598797

%N Iteration numbers k for which MD5^k(128 bits 1) yields record lows.

%C We consider iterations of the MD5 function which returns a 128-bit hash value as "message digest" for any input sequence of bits. We can feed this result again as input (of length = 128 bit) to the MD5 function. Since we are here interested in record lows, we use as starting value the lexicographically largest possible 128-bit input which consists of 128 bits 1.

%C We list "iteration numbers" k such that the k-fold repeated MD5 function yields record low values.

%C This is the analog to A393294 which lists the k-values for record highs when starting with 128 bits 0, similar to A234849 which also the iteration numbers for record highs, but starting with an empty message "" (of length = 0 bits).

%C The sequence is finite, since the record lows corresponding to the iteration numbers are strictly decreasing to 0.

%H Michael S. Branicky, <a href="/A393134/a393134.txt">Table of n, a(n), record value (in hex), # of leading zeros</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/MD5">MD5</a>.

%e We consider as initial value for the iterations the message that consists of 128 bits 1, or 16 bytes 255 = 0xff. This represents the largest integer that can be encoded with 128 bits, and the largest possible bit-string of length 128 in lexicographic order. As explained in Comments, we consider this by convention as the first (or "zeroth") record low.

%e The following table gives iteration numbers k and the resulting 128 bit message digest in its 32-digit hexadecimal representation, which is fed into the MD5 function at the next iteration:

%e k | MD5^k(128 bits 1) | #lz | record low?

%e ---------+----------------------------------+----------------

%e 0 | ffffffffffffffffffffffffffffffff | 0 | yes => a(1) = 0

%e 1 | 8d79cbc9a4ecdde112fc91ba625b13c2 | 0 | yes => a(2) = 1

%e 2 | d1096c73e4bec6f9dd017fb2a10b1b54 | 0 | no

%e 3 | cdf209766e869c13551dc45acbd90019 | 0 | no

%e 4 | d539daa1d96959674dbca360f53edf0f | 0 | no

%e 5 | 43bb38f62f513fa28cf28a59d7512540 | 1 | yes => a(3) = 5

%e 6 | 790040fd40f963fb6640ab35f46a113f | 1 | no

%e 7 | 0b065300a3311ae95c43b45d0414d28f | 4 | yes => a(4) = 7

%e ... | ... | ... | no

%e 42 | 04ac12e0b34aff0ad4fb85ce49991bf6 | 5 | yes => a(5) = 42

%e 147 | 0023b5149f0842a563334c2fe1953199 | 10 | yes => a(6) = 147

%e 176 | 001627f5de9615fb2191d3f0fe6eaa44 | 11 | yes => a(7) = 176

%e 3536 | 0012dfe3be2189f5a1badd6925cc56b7 | 11 | yes => a(8) = 3536

%e 5866 | 000b21673f479bb0835d7518dbcf13e4 | 12 | yes => a(9) = 5866

%e 8099 | 00058ec88240a1c9be957d797641fd9a | 13 | yes => a(10) = 8099

%e 38939 | 0000b1850cbc3a9da2a076fab4cd5f7a | 16 | yes => a(11)

%e 41788 | 00000ce88696e96703e30a0921e8e27b | 20 | yes => a(12)

%e 822951 | 00000b6884ef416ed523f28ef71ebd46 | 20 | yes => a(13)

%e 2971632 | 0000084a3b17caaf5c20b165e9ffc31d | 20 | yes => a(14)

%e 6665500 | 0000001bec3cc044e45efcb77b316ef8 | 27 | yes => a(15)

%e ... | ... | ... | ...

%e The column "#lz" gives the number of leading 0-bits, which for the record values are: 0, 0, 1, 4, 5, 10, 11, 11, 12, 13, 16, 20, 20, 20, 27, ....

%o (Python)

%o from hashlib import md5

%o def A393134_gen(starting_value = 2**128-1): # optional alt. starting value

%o record = b'\xff'*17; msg = starting_value.to_bytes(16)# byteorder='big'

%o for i in range(1<<63): # sys.maxint: practically infinity

%o if msg < record: record = msg; yield i; #print(i, msg.hex())

%o msg = md5(msg).digest()

%o print([an for an,i in zip(A393134_gen(),range(12))])

%Y Cf. A234849, A393294 (record highs when starting with 0).

%K nonn,hard,more,fini

%O 1,3

%A _M. F. Hasler_, Mar 08 2026

%E a(16)-a(21) from _Michael S. Branicky_, Mar 10 2026