s = 0 unseen = 0 seen(v) = bit test(s, v) see(v) = s = bit or(s, 2^v); while (seen(unseen), unseen++) tozeck(n) = { for (i=0, oo, if (n<=fibonacci(2+i), my (v=0, f); forstep (j=i, 0, -1, if (n>=f=fibonacci(2+j), n-=f; v+=2^j; ); if (n==0, return (v); ); ); ); ); } cache = apply(tozeck, [0..12 000]) other(p) = { see(p); my (pp=cache[1+p]); for (v=unseen, oo, if (!seen(v) && bitand(pp, cache[1+v])==0, return (v); ); ); } for (n=0, 10 000, print (n " " v=if (n==0, 0, other(v)))) quit