This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A262192 #20 Dec 29 2020 09:03:35 %S A262192 0,0,1,0,3,4,5,12,21,36,43,88,133,222,331,450,753,1120,1703,2508,3753, %T A262192 5010,7807,11020,16243,22974,33277,46764,63639,91822,127943,180048, %U A262192 249585,348204,480361,664618,884833,1237470,1675087,2299104,3103203,4234072,5700371 %N A262192 Number of compositions of n such that the maximal distance between two identical parts equals one. %H A262192 Vaclav Kotesovec, <a href="/A262192/b262192.txt">Table of n, a(n) for n = 0..900</a> (terms 0..650 from Alois P. Heinz) %e A262192 a(2) = 1: 11. %e A262192 a(4) = 3: 22, 112, 211. %e A262192 a(5) = 4: 113, 122, 221, 311. %e A262192 a(6) = 5: 33, 114, 411, 1122, 2211. %e A262192 a(7) = 12: 115, 133, 223, 322, 331, 511, 1123, 1132, 2113, 2311, 3112, 3211. %e A262192 a(8) = 21: 44, 116, 224, 233, 332, 422, 611, 1124, 1133, 1142, 1223, 1322, 2114, 2213, 2231, 2411, 3122, 3221, 3311, 4112, 4211. %p A262192 g:= proc(n, k) option remember; `if`(k<0 or n<0, 0, %p A262192 `if`(k=0, `if`(n=0, 1, 0), g(n-k, k)+k*g(n-k, k-1))) %p A262192 end: %p A262192 b:= proc(n, i) option remember; expand(`if`(i*(i+1)<n, 0, %p A262192 `if`(n=0, 1, `if`(i<1, 0, add(b(n-i*j, i-1)* %p A262192 `if`(j=0, 1, x) , j=0..2))))) %p A262192 end: %p A262192 a:= n-> (p-> add(coeff(p, x, i)*i!, i=0..degree(p)))(b(n$2)) %p A262192 -add(g(n, k), k=0..floor((sqrt(8*n+1)-1)/2)): %p A262192 seq(a(n), n=0..50); %t A262192 g[n_, k_] := g[n, k] = If[k < 0 || n < 0, 0, If[k == 0, If[n == 0, 1, 0], g[n - k, k] + k*g[n - k, k - 1]]]; %t A262192 b[n_, i_] := b[n, i] = Expand[If[i(i+1) < n, 0, If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]*If[j == 0, 1, x], {j, 0, 2}]]]]]; %t A262192 a[n_] := With[{p = b[n, n]}, Sum[Coefficient[p, x, i]*i!, {i, 0, Exponent[p, x]}]] - Sum[g[n, k], {k, 0, Floor[(Sqrt[8n + 1] - 1)/2]}]; %t A262192 a /@ Range[0, 50] (* _Jean-François Alcover_, Dec 29 2020, after _Alois P. Heinz_ *) %Y A262192 Column k=1 of A262191. %K A262192 nonn %O A262192 0,5 %A A262192 _Alois P. Heinz_, Sep 14 2015