cp's OEIS Frontend

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.

A317329 Number of permutations of [n] with equal lengths of increasing runs.

This page as a plain text file.
%I A317329 #15 Aug 01 2021 06:45:09
%S A317329 1,2,2,7,2,82,2,1456,1515,50774,2,3052874,2,199364414,136835794,
%T A317329 19451901825,2,2510158074714,2,370671075758054,132705620239756,
%U A317329 69348874393843334,2,15772160279898993782,613498040952503,4087072509293134292962,705927677748508225534
%N A317329 Number of permutations of [n] with equal lengths of increasing runs.
%H A317329 Alois P. Heinz, <a href="/A317329/b317329.txt">Table of n, a(n) for n = 1..400</a>
%F A317329 a(n) = 2 <=> n in { A000040 }.
%e A317329 a(4) = 7: 1234, 1324, 1423, 2314, 2413, 3412, 4321.
%p A317329 b:= proc(u, o, t, d) option remember; `if`(u+o=0, 1,
%p A317329       `if`(t=d, add(b(u-j, o+j-1, 1, d), j=1..u),
%p A317329        add(b(u+j-1, o-j, t+1, d), j=1..o)))
%p A317329     end:
%p A317329 a:= proc(n) option remember; `if`(n=1, 1, 2+add(
%p A317329       b(n, 0, d$2), d=numtheory[divisors](n) minus {1, n}))
%p A317329     end:
%p A317329 seq(a(n), n=1..35);
%t A317329 b[u_, o_, t_, d_] := b[u, o, t, d] = If[u + o == 0, 1,
%t A317329      If[t == d, Sum[b[u - j, o + j - 1, 1, d], {j, 1, u}],
%t A317329      Sum[b[u + j - 1, o - j, t + 1, d], {j, 1, o}]]];
%t A317329 a[n_] := a[n] = If[n == 1, 1, 2 + Sum[b[n, 0, d, d], {d, Divisors[n] ~Complement~ {1, n}}]];
%t A317329 Array[a, 35] (* _Jean-François Alcover_, Aug 01 2021, after _Alois P. Heinz_ *)
%Y A317329 Column k=1 of A317327.
%Y A317329 Cf. A000040, A005225.
%K A317329 nonn
%O A317329 1,2
%A A317329 _Alois P. Heinz_, Jul 25 2018