A317130
Number of permutations of [n] whose lengths of increasing runs are triangular numbers.
Original entry on oeis.org
1, 1, 1, 2, 7, 24, 93, 483, 2832, 17515, 123226, 978405, 8312802, 75966887, 756376739, 8070649675, 91320842018, 1099612368110, 14054043139523, 189320856378432, 2682416347625463, 39945105092501742, 623240458310527252, 10160826473676346731, 172871969109661492526
Offset: 0
a(2) = 1: 21.
a(3) = 2: 123, 321.
a(4) = 7: 1243, 1342, 2134, 2341, 3124, 4123, 4321.
a(5) = 24: 12543, 13542, 14532, 21354, 21453, 23541, 24531, 31254, 31452, 32145, 32451, 34521, 41253, 41352, 42135, 42351, 43125, 51243, 51342, 52134, 52341, 53124, 54123, 54321.
-
g:= n-> `if`(issqr(8*n+1), 1, 0):
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..27);
-
g[n_] := If[IntegerQ @ Sqrt[8n+1], 1, 0];
b[u_, o_, t_] := b[u, o, t] = If[u+o==0, g[t], If[g[t]==1, Sum[b[u-j, o+j-1, 1], {j, 1, u}], 0] + Sum[b[u+j-1, o-j, t+1], {j, 1, o}]];
a[n_] := b[n, 0, 0];
a /@ Range[0, 27] (* Jean-François Alcover, Apr 29 2020, after Alois P. Heinz *)
A317128
Number of permutations of [n] whose lengths of increasing runs are Fibonacci numbers.
Original entry on oeis.org
1, 1, 2, 6, 23, 112, 652, 4425, 34358, 299971, 2910304, 31059715, 361603228, 4560742758, 61947243329, 901511878198, 13994262184718, 230811430415207, 4030772161073249, 74301962970014978, 1441745847111969415, 29374226224980834077, 626971133730275593916
Offset: 0
-
g:= n-> (t-> `if`(issqr(t+4) or issqr(t-4), 1, 0))(5*n^2):
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..27);
-
g[n_] := With[{t = 5n^2}, If[IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4], 1, 0]];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
a[n_] := b[n, 0, 0];
a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)
A317129
Number of permutations of [n] whose lengths of increasing runs are squares.
Original entry on oeis.org
1, 1, 1, 1, 2, 9, 40, 151, 571, 2897, 19730, 140190, 953064, 6708323, 54631552, 510143776, 4987278692, 49168919669, 505209884549, 5638095015594, 67921924172174, 852861260421398, 10992380368532792, 147296144926635359, 2082906807168675698, 30973237281668975230
Offset: 0
a(3) = 1: 321.
a(4) = 2: 1234, 4321.
a(5) = 9: 12354, 12453, 13452, 21345, 23451, 31245, 41235, 51234, 54321.
-
g:= n-> `if`(issqr(n), 1, 0):
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..27);
-
g[n_] := If[IntegerQ@Sqrt[n], 1, 0];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
a[n_] := b[n, 0, 0];
a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)
A317131
Number of permutations of [n] whose lengths of increasing runs are prime numbers.
Original entry on oeis.org
1, 0, 1, 1, 5, 19, 80, 520, 2898, 22486, 171460, 1509534, 14446457, 147241144, 1650934446, 19494460567, 248182635904, 3340565727176, 47659710452780, 718389090777485, 11381176852445592, 189580213656445309, 3305258537062221020, 60273557241570401742
Offset: 0
a(2) = 1: 12.
a(3) = 1: 123.
a(4) = 5: 1324, 1423, 2314, 2413, 3412.
a(5) = 19: 12345, 12435, 12534, 13245, 13425, 13524, 14235, 14523, 15234, 23145, 23415, 23514, 24135, 24513, 25134, 34125, 34512, 35124, 45123.
-
g:= n-> `if`(n=0 or isprime(n), 1, 0):
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..27);
-
g[n_] := If[n == 0 || PrimeQ[n], 1, 0];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
a[n_] := b[n, 0, 0];
a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)
-
from functools import lru_cache
from sympy import isprime
def g(n): return int(n == 0 or isprime(n))
@lru_cache(maxsize=None)
def b(u, o, t):
if u + o == 0: return g(t)
return (sum(b(u-j, o+j-1, 1) for j in range(1, u+1)) if g(t) else 0) +\
sum(b(u+j-1, o-j, t+1) for j in range(1, o+1))
def a(n): return b(n, 0, 0)
print([a(n) for n in range(28)]) # Michael S. Branicky, Mar 29 2021 after Alois P. Heinz
A317132
Number of permutations of [n] whose lengths of increasing runs are factorials.
Original entry on oeis.org
1, 1, 2, 5, 17, 70, 350, 2029, 13495, 100813, 837647, 7652306, 76282541, 823684964, 9578815164, 119346454671, 1586149739684, 22397700381817, 334879465463998, 5285103821004717, 87800206978975107, 1531533620821692217, 27987305231654121046, 534688325008397289484
Offset: 0
-
g:= proc(n) local i; 1; for i from 2 do
if n=% then 1; break elif n<% then 0; break fi;
%*i od; g(n):=%
end:
b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
`if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
add(b(u+j-1, o-j, t+1), j=1..o))
end:
a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 1), j=1..n)):
seq(a(n), n=0..27);
-
g[n_] := g[n] = Module[{i, k = 1}, For[i = 2, True, i++,
If[n == k, k = 1; Break[]]; If[n < k, k = 0; Break[]];
k = k*i]; k];
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, 1], {j, 1, n}]];
a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021~, after Alois P. Heinz *)
A322251
Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 3).
Original entry on oeis.org
1, 1, 1, 2, 8, 32, 132, 702, 4566, 31670, 237446, 2010626, 18782106, 187594266, 2009039346, 23200862726, 286250968646, 3740867774726, 51734894498790, 756345994706634, 11641318110171330, 188004200777993570, 3180713596572408650, 56276908859288339822
Offset: 0
A322262
Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 6).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 2, 14, 98, 546, 2562, 10626, 41118, 174174, 1093092, 10005996, 98041944, 889104216, 7315812504, 55893493656, 421564046904, 3519008733240, 36011379484080, 435775334314320, 5538098453968080, 68428271204813520, 805379194188288720
Offset: 0
For n=6 the a(6)=2 permutations are 654321 and 123456.
- Seiichi Manyama, Table of n, a(n) for n = 0..514
- David Galvin, John Engbers, and Clifford Smyth, Reciprocals of thinned exponential series, arXiv:2303.14057 [math.CO], 2023.
- Ira M. Gessel, Reciprocals of exponential polynomials and permutation enumeration, arXiv:1807.09290 [math.CO], 2018.
A322276
Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 5).
Original entry on oeis.org
1, 1, 1, 1, 1, 2, 12, 72, 352, 1472, 5756, 26336, 180116, 1577006, 13720566, 109776526, 829240726, 6488348726, 59134377126, 640605185526, 7502207070150, 87309498759810, 989782736128170, 11277397727184650, 136523328121058170, 1817775858886701082
Offset: 0
A322297
Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 7).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 2, 16, 128, 800, 4160, 18944, 78080, 301160, 1208066, 6753606, 60823622, 648980646, 6581663766, 60475366230, 505780634070, 3921237755958, 29226687666930, 227116001463258, 2092153010685722, 24250743543656922, 322040690042341562
Offset: 0
A322298
Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 9).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 20, 200, 1520, 9440, 50624, 242816, 1066496, 4361216, 16856556, 64202712, 288983580, 2160645840, 24525417780, 294825080160, 3270522114228, 32898687457422, 302696887652022, 2577419367939422, 20537905525582022, 155236628840778062
Offset: 0
Showing 1-10 of 13 results.