[go: up one dir, main page]

login
A366061
Numbers of iterations that produce a record low of the digest of the SHA2-256 hash of the empty string.
1
1, 2, 6, 7, 36, 674, 815, 11621, 449652, 2386324, 2643745, 187894152, 704719562, 1390873253, 1625785299, 3479964180, 6909167935, 12446961112
OFFSET
1,2
COMMENTS
The SHA2-256 algorithm takes inputs of any length but here we are feeding the output of every iteration to the next.
EXAMPLE
a(1) = 1 because 1 iteration sha256("") = hex e3b0...b855 is taken as the first digest and so is a record.
a(2) = 2 is the next term since 2 times nested sha256(...(sha256("")...)) = hex 5df6...9456 is less than the previous record e3b0...b855.
PROG
(Python)
from itertools import islice
import hashlib
def g():
c, vmin, m = 1, b"\xFF" * 32, b""
while True:
if (m:= hashlib.sha256(m).digest()) < vmin:
vmin = m
yield c
c += 1
print(list(islice(g(), 16)))
CROSSREFS
Cf. A365749.
Sequence in context: A057914 A216037 A250547 * A057249 A246120 A300659
KEYWORD
nonn,more,hard,fini,base
AUTHOR
DarĂ­o Clavijo, Sep 27 2023
EXTENSIONS
a(17)-a(18) from Michael S. Branicky, Sep 28 2023
STATUS
approved