%I #10 Jul 10 2021 14:42:48
%S 0,1,3,9,29,98,341,1210,4356,15860,58276,215748,803779,3010514,
%T 11327360,42789497,162200621,616735888,2351425517,8987222524,
%U 34425268864,132128622038,508050009119,1956763431726,7548022312030,29156726321546,112773951773678,436719024636650
%N Total number of weak left-to-right maxima in Dyck paths of semilength n.
%H Aubrey Blecher and Arnold Knopfmacher, <a href="https://arxiv.org/abs/2107.03102">Left to right maxima in Dyck Paths</a>, arXiv:2107.03102 [math.CO], 2021. See Theorem 9 p. 12.
%F a(n) = Sum_{r=1..n} (d(r+2)-d(r))*(binomial(2*n-1,n-r)-binomial(2*n-1, n-r-1)) where d is A000005 and binomial is A007318.
%p a:= n-> (d-> add((binomial(2*n-1, n-r)-binomial(2*n-1, n-r-1))
%p *(d(r+2)-d(r)), r=1..n))(numtheory[tau]):
%p seq(a(n), n=0..27); # _Alois P. Heinz_, Jul 08 2021
%o (PARI) a(n) = sum(r=1, n, (numdiv(r+2)-numdiv(r))*(binomial(2*n-1,n-r)-binomial(2*n-1, n-r-1)));
%Y Cf. A000005, A007318, A346157, A346195.
%K nonn
%O 0,3
%A _Michel Marcus_, Jul 08 2021