First time here? Check out the FAQ!
answered 2013-06-13 12:58:28 +0100
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]