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) <= 5 for i = 2,...,k.
3

%I #14 Sep 30 2022 09:41:52

%S 0,1,4,11,26,57,119,242,485,964,1907,3762,7410,14583,28686,56413,

%T 110924,218091,428777,842976,1657271,3258134,6405349,12592612,

%U 24756452,48669933,95682600,188107071,369808798,727024989,1429293531,2809917134,5524151673

%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) <= 5 for i = 2,...,k.

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

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

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

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

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

%Y Cf. A001891, A356619, A356620.

%K nonn,easy

%O 0,3

%A _Clark Kimberling_, Sep 04 2022