from research import *
s=begin(753,'Transfer the defect law across traditions','Which ordinary rows have nonzero defects in each tradition?',{},['File18 rows; File51a rules'])
p=json.loads((ROOT/'model/rounding_inputs.json').read_text()); q=lambda n:5*((n+2)//5)
out={}; excluded={}
for t,rows in p['native_rows'].items():
    out[t]={}; excluded[t]=[]
    for x in rows:
        if x['begetting'] is None: continue
        if t.startswith('SP') and x['name'] in ['Jared','Methuselah','Lamech']:
            excluded[t].append(x['name']);continue
        k=q(x['begetting'])+q(x['remainder'])-q(x['lifespan'])
        if k:out[t][x['name']]={'K':k,'residues':[x['begetting']%5,x['remainder']%5]}
finish(s,{'defects':out,'inclusive_rows_not_ordinary_biographies':excluded},'LXX adds main Lamech(182+571=753), class(2,1), with defect−5. SP ordinary Reu also has−5. Inclusive SP rows remain ledger diagnostics.','Reconstruct the full MT cumulative rounding field.',{'MT':len(out['MT_native_OFF'])==2,'LXX':out['LXX_native_ON']['Lamech']['K']==-5,'SP':list(out['SP_native_OFF'])==['Reu']})
