The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A234849 Positions of records in iterated MD5 applied to empty string. 2

%I

%S 1,15,19,24,29,41,368,833,1582,12996,30527,105072,412282,571364,

%T 615279,641180,1213387,1635523,2603393,3505632,4289930,14230877,

%U 19306296,22032773,79279388,94146647,147017418,149333691,455566242,535859188,1429801665

%N Positions of records in iterated MD5 applied to empty string.

%C The MD5 message digest algorithm converts a string into a 128-bit number represented as a 32-digit lowercase hexadecimal string. Consider iterating this function starting with the empty string, MD5("") = d41d8cd98f00b204e9800998ecf8427e, MD5^{(2)}("") = MD5("d41d8cd98f00b204e9800998ecf8427e") = 74be16979710d4c4e7c6647856088456.

%C The sequence gives the iteration numbers where a record value is achieved.

%C Because each iteration produces a 128-bit number, the sequence must be finite, although it is unknown what the maximum value attained by the above iteration is.

%C From _Ben Whitmore_, Apr 03 2018: (Start)

%C It appears likely that a(39) will be much larger than a(38). This is because the first 46 bits of MD5^{a(38)}("")=fffffffffffcfade870a33bf9bba701c are all 1's, while a(38) < 2^40 << 2^46.

%C a(39) > 2^40.

%C (End)

%H Ben Whitmore, <a href="/A234849/b234849.txt">Table of n, a(n) for n = 1..38</a> (first 35 terms from Sean A. Irvine)

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

%e a(2)=15 because MD5^{(15)}("")=d4f6f4e928303d5361d83531beb5260f is larger than MD^{(n)}("") for all n<15.

%e a(28)=149333691 because MD5^{(149333691)}("")=fffffff5fedfdd0975cc5bbd15245b22 is larger than all preceding values.

%t f[w_] := FromDigits[If[# < 57, # - 48, # - 87] & /@ Flatten[ToCharacterCode /@ Characters@ w], 16]; With[{s = f /@ Rest@ NestList[Hash[#, "MD5", "HexString"] &, "", 2^16]}, Map[FirstPosition[s, #][[1]] &, Union@FoldList[Max, s]]] (* _Michael De Vlieger_, Apr 07 2018, Version 11.3 *)

%o #!/bin/bash

%o function md5() {

%o echo -n "\$1" | md5sum - | gawk '{print \$1}'

%o }

%o it=0

%o while :; do

%o it=\$[\$it+1]

%o prev=\$(md5 "\$prev")

%o if [ "\$prev" == "\$best" ]; then

%o echo "Cycle detected"

%o exit

%o elif [ "\$prev" \> "\$best" ]; then

%o best=\$prev

%o echo \$it \$prev

%o fi

%o done

%K nonn,fini,nice

%O 1,2

%A _Sean A. Irvine_, Dec 31 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified November 30 05:12 EST 2021. Contains 349419 sequences. (Running on oeis4.)