A357282 a(n) = number of subsets S of {1,2,...,n} having more than 1 element such that (difference between least two elements of S) = difference between greatest two elements of S.
0, 0, 1, 4, 9, 18, 33, 60, 109, 202, 381, 732, 1425, 2802, 5545, 11020, 21957, 43818, 87525, 174924, 349705, 699250, 1398321, 2796444, 5592669, 11185098, 22369933, 44739580, 89478849, 178957362, 357914361, 715828332, 1431656245, 2863312042, 5726623605
Offset: 0
Examples
The 4 relevant subsets of {1,2,3} are {1,2}, {1,3}, {2,3}, and {1,2,3}.
Links
- Index entries for linear recurrences with constant coefficients, signature (4,-4,-2,5,-2)
Programs
-
Mathematica
s[n_] := s[n] = Select[Subsets[Range[n]], Length[#] >= 2 &]; a[n_] := Select[s[n], #[[2]] - #[[1]] == #[[-1]] - #[[-2]] &]; Table[Length[a[n]], {n, 0, 18}]