#include #include #include int main(int argc, char **argv) { if (argc == 2) { uint32_t count = strtoul(argv[1], NULL, 10); if (count) { uint32_t *a = malloc(count * sizeof(*a)); a[0] = 0; printf("0"); for (uint32_t i = 1; i < count; i++) { uint32_t v = 0; uint32_t middle = i / 2; for (uint32_t j = 0; j < middle; j++) { if ((a[j] + a[i-j-1]) * 4 <= i) { v += 1; } } v *= 2; if (i % 2) { v += a[middle] * 8 <= i; } a[i] = v; printf(", %u", v); } } } printf("\n"); return 0; }