cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A349646 Nonnegative integers which produce a record maximum MD5 hash.

This page as a plain text file.
%I A349646 #23 Dec 25 2021 11:17:01
%S A349646 0,3,44,65,83,373,575,1126,12673,25670,30268,30525,40691,48240964,
%T A349646 63327632,298506737,369490840,1113434519,1647703600,4958115803,
%U A349646 64657664035,86155378906,184280298746,400812644253,411723964986,714853066875,1627993432495,2607864795784
%N A349646 Nonnegative integers which produce a record maximum MD5 hash.
%C A349646 a(1) = 0; a(n) is the smallest k such that MD5(k) > MD5(a(n-1)), where integer parameters to MD5 are encoded as base-10 ASCII strings.
%C A349646 If a(1) were defined as 1 instead of 0, the sequence would begin 1, 2, 3, 44, ... and then continue in the same way.
%C A349646 If we assume that MD5 behaves like a random function from N to {0, ..., 2^128-1}, the expected length of this sequence is the harmonic number H(2^128) ~= 89.3.
%C A349646 a(31) > 10^15.
%H A349646 Ben Whitmore, <a href="/A349646/b349646.txt">Table of n, a(n) for n = 1..30</a>
%H A349646 Wikipedia, <a href="http://en.wikipedia.org/wiki/MD5">MD5</a>
%e A349646 a(5) = 83 because MD5("83") = fe9fc289c3ff0af142b6d3bead98a923_16 = 338453431832254946862081270079334951203, which is larger than all previous values MD5("0"), ..., MD5("82").
%t A349646 recordsBy[l_, P_] :=
%t A349646 Module[{max = -Infinity, x, i, recs = {}},
%t A349646 For[i = 1, i <= Length[l], i++,
%t A349646   x = P[l[[i]]];
%t A349646   If[x > max,
%t A349646    max = x;
%t A349646    AppendTo[recs, l[[i]]];
%t A349646   ]
%t A349646 ];
%t A349646 recs
%t A349646 ];
%t A349646 recordsBy[Range[1000], Hash[ToString[#], "MD5"] &]
%o A349646 (Python)
%o A349646 from hashlib import md5
%o A349646 def afind(limit):
%o A349646     record = ""
%o A349646     for k in range(limit+1):
%o A349646         hash = md5(str(k).encode('utf-8')).hexdigest()
%o A349646         if hash > record:
%o A349646             print(k, end=", ")
%o A349646             record = hash
%o A349646 afind(10**5) # _Michael S. Branicky_, Nov 24 2021
%Y A349646 Record minima: A349647.
%K A349646 nonn,base,fini,hard
%O A349646 1,2
%A A349646 _Ben Whitmore_, Nov 23 2021