Let u(n) be the number of subsets of
{1,2,3,...,n}
WITH three consecutive numbers in them, and let S(n) be the collection of all such subsets.
Now a subset of {1,...,n} can be in S(n) by:
(i) being in S(n-1),
(ii) being a subset of S(n-1) with n now added,
(iii) having n-2, n-1, n in it, but not having n-3 and not having a consecutive triple in 1,...,n-4.
Putting this as a recursive relation we see
u(n) = u(n-1) + u(n-1) + [2^(n-4) - u(n-4)]
That is
u(n) = 2u(n-1) - u(n-4) + 2^(n-4)
Hence
u(1)=0,
u(2)=0,
u(3)=1,
u(4) = 3,
u(5) = 2 x 3 - 0 + 2 = 8,
u(6) = 2 x 8 - 0 + 4 = 20,
u(7) = 2 x 20 - 1 + 8 = 47,
u(8) = 2 x 47 - 3 + 16 = 107,
u(9) = 2 x 107 - 8 + 32 = 238,
u(10) = 2 x 238 - 20 + 64 = 520.
The subsets we are looking for are those without a consecutive triple, i.e. 2^n - u(n), or in the case when n=10,
1024 - 520 = 504