VOOZH about

URL: https://oeis.org/A393716

⇱ A393716 - OEIS


login
A393716
Iteration numbers k such that SHA256^{k}(256 bits of 0) is a record high value.
2
0, 1, 4, 29, 126, 393, 462, 1222, 2330, 3519, 4011, 4579, 8184, 9296, 20929, 30807, 1000126, 4337415, 8266767, 40986847, 195267237, 222548724, 222569006, 1613168964, 1795888289, 6410371713, 8660890122, 18543891806, 27253602701, 101241648070, 115330573044
OFFSET
1,3
COMMENTS
Iterations are SHA256(SHA256(...(SHA256(256 0 bits)))) with k nestings, and beginning from an input message which is 256 bits all 0.
Each hash digest is 256 bits and is a 256 bit input to the next iteration.
Bit strings are compared lexicographically, which means numerically when interpreted as 256 bit numbers (most to least significant bits).
This is a finite sequence, as there are only a finite number of hash digests (2^256 of them), but it is not known what maximum hash may be reached, nor when it is reached.
Because hash outputs are probabilistically equivalent to random values, there is a ~1/2 chance of the sequence ending at or before 90 terms, due to the underlying hash series forming a cycle. If reached, the expected value (with standard deviation) of a(90) is 2^(~128.1, s.d. ~13.6), on an underlying hash value of 2^256 - 2^(~127.6, s.d. ~13.6).
The first nonzero hash in the series, 0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925, in base 10 equals 46320509353513273106582423493727320152202237096314791991810382902766530930981.
EXAMPLE
Here 0x... notation shows hexadecimal representations of 256-bit strings, which strings are what pass as arguments and return values of the SHA256 function, interpreted numerically in digit order most to least significant for sorting purposes. The first few iterations are:
k = 0: 0x0000000000000000000000000000000000000000000000000000000000000000; record, a(1) = 0.
k = 1: 0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925; record, a(2) = 1.
k = 2: 0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e, smaller than the prevailing record.
k = 3: 0x12771355e46cd47c71ed1721fd5319b383cca3a1f9fce3aa1c8cd3bd37af20d7, smaller than the prevailing record.
k = 4: 0xfe15c0d3ebe314fad720a08b839a004c2e6386f5aecc19ec74807d1920cb6aeb; record, a(3) = 4.
...
k = 29: 0xfe4af4eb44d9b92afdc3113bc3fba48531502d6367ad42de3a7f1d1ea4065ba4; record, a(4) = 29.
PROG
(Perl) use bigint; use Digest::SHA qw(sha256); $_="\x00" x length(sha256); my $r=-1; for(my $k=0; $k<=100000; $k++) {my $t=hex(unpack("H*", $_)); if ($t>$r) {print "$k\n"; $r=$t; } $_=sha256($_); }
(Python)
from hashlib import sha256
from itertools import count, islice
def agen(): # generator of terms
x, record = b"\x00"*32, b""
yield 0
for k in count(1):
x = sha256(x).digest()
if x > record:
record = x
yield k
print(list(islice(agen(), 19))) # Michael S. Branicky, Feb 26 2026
CROSSREFS
Cf. A393294 (equivalent for MD5), A392764 (SHA1).
Sequence in context: A370435 A353972 A273074 * A247748 A295035 A389154
KEYWORD
nonn,fini
AUTHOR
Charles L. Hohn, Feb 26 2026
STATUS
approved