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 A240796 #28 Feb 22 2025 15:01:01 %S A240796 0,1,15,186,2330,31065,447405,6979588,117745668,2141106795, %T A240796 41810587775,873474855726,19451904450654,460209050303821, %U A240796 11531197020389025,305122289460210120,8503747639606509128,249020038061419770783,7645072502094118876755,245564189847880300238290 %N A240796 Total number of occurrences of the pattern 1<2 in all preferential arrangements (or ordered partitions) of n elements. %C A240796 There are A000670(n) preferential arrangements of n elements - see A000670, A240763. %C A240796 The number that avoid the pattern 1<2 is 2^(n-1). %C A240796 The total number of occurrences of the pattern 1<2 in all permutations on n elements is (n-1)*(n-1)! (cf. A010027, A001563). %H A240796 Alois P. Heinz, <a href="/A240796/b240796.txt">Table of n, a(n) for n = 1..420</a> %F A240796 a(n) ~ n! * n^2 / (8 * (log(2))^(n+1)). - _Vaclav Kotesovec_, May 03 2015 %F A240796 a(n) = Sum_{k=0..binomial(n,2)} k * A381299(n,k). - _Alois P. Heinz_, Feb 22 2025 %e A240796 The 13 preferential arrangements on 3 points and the number of times the pattern 1<2 occurs are: %e A240796 1<2<3, 3 %e A240796 1<3<2, 2 %e A240796 2<1<3, 2 %e A240796 2<3<1, 1 %e A240796 3<1<2, 1 %e A240796 3<2<1, 0 %e A240796 1=2<3, 2 %e A240796 1=3<2, 1 %e A240796 2=3<1, 0 %e A240796 1<2=3, 2 %e A240796 2<1=3, 1 %e A240796 3<1=2, 0 %e A240796 1=2=3, 0, %e A240796 for a total of a(3) = 15. %p A240796 b:= proc(n, t) option remember; `if`(n=0, [1, 0], add((p-> p+ %p A240796 [0, p[1]*j*t/2])(b(n-j, t+j))*binomial(n, j), j=1..n)) %p A240796 end: %p A240796 a:= n-> b(n, 0)[2]: %p A240796 seq(a(n), n=1..25); # _Alois P. Heinz_, Dec 08 2014 %t A240796 b[n_, t_] := b[n, t] = If[n == 0, {1, 0}, Sum[Function[{p}, p + {0, p[[1]]*j*t/2}][b[n - j, t + j]]*Binomial[n, j], {j, 1, n}]]; a[n_] := b[n, 0][[2]]; Table[a[n], {n, 1, 25}] (* _Jean-François Alcover_, Jun 08 2015, after _Alois P. Heinz_ *) %Y A240796 Cf. A000670, A240763, A240796-A240800, A010027, A001563, A264082, A381299. %K A240796 nonn %O A240796 1,3 %A A240796 _N. J. A. Sloane_, Apr 13 2014 %E A240796 a(8)-a(20) from _Alois P. Heinz_, Dec 08 2014