login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317446 Number of permutations of [n] whose lengths of increasing runs are distinct triangular numbers. 6

%I #11 Jul 14 2021 04:27:17

%S 1,1,0,1,6,0,1,12,0,166,3687,20,0,570,18514,1,16044,689458,1630,

%T 46150176,2799527248,108527,6182180,0,653209572,50529806020,457774882,

%U 592018,64091958837,5934158290988,7151183666,15132424235658,1574449800015044,0,342747690810188908

%N Number of permutations of [n] whose lengths of increasing runs are distinct triangular numbers.

%H Alois P. Heinz, <a href="/A317446/b317446.txt">Table of n, a(n) for n = 0..160</a>

%F a(n) = 0 <=> n in { A053614 }.

%F a(n) > 0 <=> n in { A061208 }.

%p g:= (n, s)-> `if`(n in s or not issqr(8*n+1), 0, 1):

%p b:= proc(u, o, t, s) option remember; `if`(u+o=0, g(t, s),

%p `if`(g(t, s)=1, add(b(u-j, o+j-1, 1, s union {t})

%p , j=1..u), 0)+ add(b(u+j-1, o-j, t+1, s), j=1..o))

%p end:

%p a:= n-> b(n, 0$2, {}):

%p seq(a(n), n=0..40);

%t g[n_, s_] := If[MemberQ[s, n] || !IntegerQ@Sqrt[8*n + 1], 0, 1];

%t b[u_, o_, t_, s_] := b[u, o, t, s] = If[u + o == 0, g[t, s],

%t If[g[t, s] == 1, Sum[b[u - j, o + j - 1, 1, s ~Union~ {t}],

%t {j, 1, u}], 0] + Sum[b[u + j - 1, o - j, t + 1, s], {j, 1, o}]];

%t a[n_] := b[n, 0, 0, {}];

%t Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Jul 14 2021, after _Alois P. Heinz_ *)

%Y Cf. A000217, A053614, A061208, A317130, A317444, A317445, A317447, A317448.

%K nonn

%O 0,5

%A _Alois P. Heinz_, Jul 28 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 17:39 EDT 2024. Contains 371797 sequences. (Running on oeis4.)