A177259
Number of derangements of {1,2,...,n} having no adjacent 3-cycles (an adjacent 3-cycle is a cycle of the form (i,i+1,i+2)).
Original entry on oeis.org
1, 0, 1, 1, 9, 41, 258, 1809, 14575, 131660, 1320264, 14551987, 174887262, 2276174790, 31895551245, 478783042890, 7665081036273, 130370168718467, 2347620603019159, 44620121619435141, 892663172726141844, 18750621868455013979, 412602921349249182309
Offset: 0
a(5)=41 because among the 44 (= A000166(5)) derangements of {1,2,3,4,5} only (12)(345), (123)(45), and (15)(234) have adjacent 3-cycles.
-
F:=Factorial;
A177258:= func< n | (&+[(&+[(-1)^(j+k)*F(n-2*k)/(F(j)*F(k)): k in [0..Floor((n-j)/3)]]): j in [0..n]]) >;
[A177258(n): n in [0..40]]; // G. C. Greubel, May 13 2024
-
a := proc (n) local ct, t, s: ct := 0: for s from 0 to n do for t from 0 to (1/3)*n do if s+3*t <= n then ct := ct+(-1)^(s+t)*factorial(n-2*t)/(factorial(s)*factorial(t)) else end if end do end do: ct end proc; seq(a(n), n = 0 .. 22);
-
a[n_] := Module[{ct = 0, t, s}, For[s = 0, s <= n, s++, For[t = 0, t <= n/3, t++, If[s + 3*t <= n, ct = ct + (-1)^(s + t)*Factorial[n - 2*t] / (Factorial[s]*Factorial[t])]]]; ct];
Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Nov 24 2017, translated from Maple *)
-
f=factorial;
def A177259(n): return sum(sum((-1)^(j+k)*f(n-2*k)/(f(j)*f(k)) for k in range(1+(n-j)//3)) for j in range(n+1))
[A177259(n) for n in range(41)] # G. C. Greubel, May 13 2024
A177260
Number of derangements of {1,2,...,n} having no adjacent 4-cycles (an adjacent 4-cycle is a cycle of the form (i,i+1,i+2,i+3)).
Original entry on oeis.org
1, 0, 1, 2, 8, 44, 262, 1846, 14789, 133232, 1333112, 14669758, 176081478, 2289458896, 32056423888, 480890367598, 7694774125983, 130818028518432, 2354820682603399, 44743035640567412, 894883797133726171, 18792952193893804872, 413452012727711517437
Offset: 0
a(6)=262 because among the 265 (= A000166(6)) derangements of {1,2,3,4,5,6} only (1234)(56), (16)(2345), and (12)(3456) have adjacent 4-cycles.
-
F:=Factorial;
A177258:= func< n | (&+[(&+[(-1)^(j+k)*F(n-3*k)/(F(j)*F(k)): k in [0..Floor((n-j)/4)]]): j in [0..n]]) >;
[A177258(n): n in [0..40]]; // G. C. Greubel, May 13 2024
-
a := proc (n) local ct, t, s: ct := 0: for s from 0 to n do for t from 0 to (1/4)*n do if s+4*t <= n then ct := ct+(-1)^(s+t)*factorial(n-3*t)/(factorial(s)*factorial(t)) else end if end do end do: ct end proc; seq(a(n), n = 0 .. 22);
-
a[n_] := Module[{ct = 0, t, s}, For[s = 0, s <= n, s++, For[t = 0, t <= n/3, t++, If[s + 4*t <= n, ct = ct + (-1)^(s + t)*Factorial[n - 3*t] / (Factorial[s]*Factorial[t])]]]; ct];
Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Nov 24 2017, translated from Maple *)
-
f=factorial;
def A177260(n): return sum(sum((-1)^(j+k)*f(n-3*k)/(f(j)*f(k)) for k in range(1+(n-j)//4)) for j in range(n+1))
[A177260(n) for n in range(41)] # G. C. Greubel, May 13 2024
A177261
Number of derangements of {1,2,...,n} having no adjacent 2-cycles and no adjacent 3-cycles (an adjacent q-cycle is a cycle of the form (i,i+1,i+2,...,i+q-1)).
Original entry on oeis.org
1, 0, 0, 1, 7, 35, 218, 1574, 12883, 117956, 1195590, 13295211, 160974037, 2108348871, 29704448652, 447997026724, 7201873573981, 122939256681704, 2221004487898100, 42336428273893565, 849195448479132811, 17879882855311478795, 394291291121879453430
Offset: 0
a(5)=35 because among the 44 (= A000166(5)) derangements of {1,2,3,4,5} only (12)(345), (12)(354), (145)(23), (154)(23), (125)(34), (152)(34), (123)(45), (132)(45) , and (15)(234) have adjacent 2-cycles or adjacent 3-cycles (or both).
-
m:=30;
R:=PowerSeriesRing(Integers(), m);
Coefficients(R!( (&+[Factorial(k)*(x*(1-x)/(1-x^4))^(k+1)/x: k in [0..m+2]]) )); // G. C. Greubel, May 13 2024
-
a := proc (n) local ct, t, s, u: ct := 0: for s from 0 to n do for t from 0 to n do for u from 0 to n do if s+2*t+3*u <= n then ct := ct+(-1)^(s+t+u)*factorial(n-t-2*u)/(factorial(s)*factorial(t)*factorial(u)) else end if end do end do end do: ct end proc; seq(a(n), n = 0 .. 22);
-
a[n_] := Sum[If[s + 2*t + 3*u <= n, (-1)^(s + t + u)*(n - t - 2 u)!/(s! t! u!), 0], {s, 0, n}, {t, 0, n}, {u, 0, n}];
Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Dec 04 2017 *)
With[{m=40}, CoefficientList[Series[Sum[k!*(x*(1-x)/(1-x^4))^(k+1)/x,{k,0,m+2}], {x,0,m}], x]] (* G. C. Greubel, May 13 2024 *)
-
m=30
def A177261_list(prec):
P. = PowerSeriesRing(ZZ, prec)
return P( sum(factorial(k)*(x*(1-x)/(1-x^4))^(k+1)/x for k in range(m+3)) ).list()
A177261_list(m) # G. C. Greubel, May 13 2024
A370324
Number of derangements of [n] having no adjacent 2-cycles, no adjacent 3-cycles, no adjacent 4-cycles and no adjacent 5-cycles.
Original entry on oeis.org
1, 0, 0, 1, 6, 34, 217, 1567, 12842, 117704, 1193802, 13280778, 160843345, 2107036346, 29689965966, 447822830067, 7199604972876, 122907451783308, 2220526880775841, 42328779624824103, 849065324387063412, 17877539166289948864, 394246737752465047380
Offset: 0
A370323
Number of derangements of [n] having no adjacent 2-cycles, no adjacent 3-cycles and no adjacent 4-cycles.
Original entry on oeis.org
1, 0, 0, 1, 6, 35, 217, 1568, 12848, 117738, 1194019, 13282346, 160856190, 2107154067, 29691159876, 447836111629, 7199765822643, 122909558878512, 2220556571338744, 42329227454294820, 849072524072460101, 17877662074795269964, 394248958294191005180
Offset: 0
Showing 1-5 of 5 results.