N = 2000000: greedy terms = 244915, closed-form terms = 244915, mismatches = 0 gate identities Y1 = not PairSum Y0, Y2 = not PairSum Y1, Y0(n+1) = not PairSum Y2(n): OK for n <= 40817 first 40 terms: [1, 2, 3, 5, 7, 13, 22, 27, 28, 32, 36, 40, 47, 48, 52, 63, 71, 77, 81, 89, 97, 101, 112, 120, 130, 138, 146, 150, 161, 169, 179, 187, 195, 199, 203, 218, 228, 236, 244, 248] max gap up to N: 19 distinct gaps: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 15, 19] q with 49q+7 selected (first 30): [0, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56]