login
a(n) = number of k-tuples (u(1), u(2), ..., u(k)) with 1 <= u(1) < u(2) < ... < u(k) <= n such that u(i) - u(i-1) <= 4 for i = 2,...,k.
3

%I #12 Sep 07 2022 12:27:18

%S 0,1,4,11,26,56,115,230,453,884,1716,3321,6416,12383,23886,46060,

%T 88803,171194,330009,636136,1226216,2363633,4556076,8782147,16928162,

%U 32630112,62896595,121237118,233692093,450456028,868281948,1673667305,3226097496,6218502903

%N a(n) = number of k-tuples (u(1), u(2), ..., u(k)) with 1 <= u(1) < u(2) < ... < u(k) <= n such that u(i) - u(i-1) <= 4 for i = 2,...,k.

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,0,0,-1,1).

%F G.f.: (x (-1 - x - x^2 - x^3))/((-1 + x)^2 (-1 + x + x^2 + x^3 + x^4)).

%F a(n) = 3*a(n-1) - 2*a(n-2) - a(n-5) + a(n-6).

%t maxDiff = 4; t = Map[Length[Select[Map[{#, Max[Differences[#]]} &,

%t Drop[Subsets[Range[#]], # + 1]], #[[2]] <= maxDiff &]] &, Range[18]]

%Y Cf. A001891, A356619, A356621.

%K nonn,easy

%O 0,3

%A _Clark Kimberling_, Sep 04 2022