Ask Your Question

Revision history [back]

By the way, you can shorten the definition of your function nkfilter by doing:

sage: nkfilter = lambda N : [[n, k] for n in range(2, N+1) for k in range(1, n) if bin(n, k) <= N]