Number of subsets of [n], numbers in subset a distance of at least 3

Number of subsets of [n], numbers in subset a distance of at least
3 units from each other:
If we view the numbers in the set as bars and the numbers not in the
set as dots, then the number of subsets of size k is equal to the number of
solutions to
x1 + x2 + · · · + xk+1 = n − k
where x1 ≥ 0, xk+1 ≥ 0, and xi ≥ 2 for 2 ≤ i ≤ k. This works even for
k = 0, which corresponds to the empty set. This is the same as the number
of solutions to
y1 + y2 + · · · + yk+1 = n − 3k + 2
where yi ≥ 0 for 1 ≤ i ≤ k + 1. These are represented
by rearrangements of
n−2k+2
n − 3k + 2 dots and k bars. So there are
subsets of size k. The total
k
P
n−2k+2
number of subsets is k≥0
. We wish to simplify this.
k
P
A generating function for k≥0 n−ak
, where a ≥ 0 is an integer: We
k
have
x(a+1)k
n − ak
n − (a + 1)k + k
1
n
=
[x
]
,
=
= [xn−(a+1)k ]
(1 − x)k+1
(1 − x)k+1
k
k
therefore
X n − ak X
X x(a+1)k
x(a+1)k
1
n
n
n
[x ]
=
= [x ]
= [x ]
k
(1 − x)k+1
(1 − x)k+1
1−x
k≥0
k≥0
k≥0
= [xn ]
1
a+1
1 − x1−x
1
.
1 − x − xa+1
Applying this to our problem, we have
X n − 2k + 2
1
= [xn+2 ]
.
3
k
1
−
x
−
x
k≥0
Using Mathematica, we have
1
= 1+x+x2 +2x3 +3x4 +4x5 +6x6 +9x7 +13x8 +19x9 +28x10 +· · · .
3
1−x−x
1
!
This says, for example, that there are 19 subsets of [7] that have the desired
property. The subsets are
{}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {1, 4}, {1, 5}, {1, 6}, {1, 7},
{2, 5}, {2, 6}, {2, 7}, {3, 6}, {3, 7}, {4, 7}, {1, 4, 7}.
2