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.

A317129 Number of permutations of [n] whose lengths of increasing runs are squares.

This page as a plain text file.
%I A317129 #14 Mar 29 2021 08:00:33
%S A317129 1,1,1,1,2,9,40,151,571,2897,19730,140190,953064,6708323,54631552,
%T A317129 510143776,4987278692,49168919669,505209884549,5638095015594,
%U A317129 67921924172174,852861260421398,10992380368532792,147296144926635359,2082906807168675698,30973237281668975230
%N A317129 Number of permutations of [n] whose lengths of increasing runs are squares.
%H A317129 Alois P. Heinz, <a href="/A317129/b317129.txt">Table of n, a(n) for n = 0..400</a>
%e A317129 a(3) = 1: 321.
%e A317129 a(4) = 2: 1234, 4321.
%e A317129 a(5) = 9: 12354, 12453, 13452, 21345, 23451, 31245, 41235, 51234, 54321.
%p A317129 g:= n-> `if`(issqr(n), 1, 0):
%p A317129 b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
%p A317129       `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
%p A317129        add(b(u+j-1, o-j, t+1), j=1..o))
%p A317129     end:
%p A317129 a:= n-> b(n, 0$2):
%p A317129 seq(a(n), n=0..27);
%t A317129 g[n_] := If[IntegerQ@Sqrt[n], 1, 0];
%t A317129 b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
%t A317129      If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
%t A317129      Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
%t A317129 a[n_] := b[n, 0, 0];
%t A317129 a /@ Range[0, 27] (* _Jean-François Alcover_, Mar 29 2021, after _Alois P. Heinz_ *)
%Y A317129 Cf. A000290, A097597, A205801, A317111, A317128, A317130, A317131, A317132, A317445.
%K A317129 nonn
%O A317129 0,5
%A A317129 _Alois P. Heinz_, Jul 21 2018