A078630
Numerators of coefficients of asymptotic expansion of probability p(n) (see A002816) in powers of 1/n.
Original entry on oeis.org
1, -4, 0, 20, 58, 796, 7858, 40324, 140194, 2444744, 40680494, -7117319032, -149539443124, -223750776484, -4960419494993024, -46146161037854692, -689434674121075448, -132496988938839119444, -9686633414582239854958, -442788087926096759821484
Offset: 0
p(n) = exp(-2)*(1 - 4/n + 20/(3n^3) + 58/(3n^4) + ...).
-
t = 15;
y[n_]:=(1+Sum[Subscript[p,k]/n^k,{k,1,t}]);
mul=1;start=9; If[t>9,mul=n^(t-9);start=t];
w=Apart[Expand[mul*Simplify[
y[n]*n*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-((3*n-30)*y[n-11]
+(6*n-45)*y[n-10]*(n-10)
+(5*n+18)*y[n-9]*(n-9)*(n-10)
-(8*n-139)*y[n-8]*(n-8)*(n-9)*(n-10)
-(26*n-204)*y[n-7]*(n-7)*(n-8)*(n-9)*(n-10)
-(4*n-30)*y[n-6]*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(26*n-148)*y[n-5]*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(8*n-74)*y[n-4]*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-(9*n-18)*y[n-3]*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-(2*n-15)*y[n-2]*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(n+2)*y[n-1]*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10))],n],n];
sol=Solve[Table[Coefficient[w,n,j]==0,{j,start,start-t+1,-1}]];
asympt=y[n]/.sol[[1]];
Table[Numerator[Coefficient[asympt,n,-j]],{j,0,t}] (* Vaclav Kotesovec, Apr 06 2012 *)
Terms a(5)-a(19) from Vaclav Kotesovec, Apr 06 2012 (terms a(5)-a(7) were wrong, see
A089222 for more information)
A078631
Denominators of coefficients of asymptotic expansion of probability p(n) (see A002816) in powers of 1/n.
Original entry on oeis.org
1, 1, 1, 3, 3, 15, 45, 63, 63, 405, 14175, 51975, 93555, 15795, 42567525, 49116375, 91216125, 2170943775, 19538493975, 109185701625, 3093594879375, 10257709336875, 428772250281375, 281764621613475, 158210081654625, 160789593855515625
Offset: 0
p(n) = exp(-2)*(1 - 4/n + 20/(3n^3) + 58/(3n^4) + ...).
-
t = 15;
y[n_]:=(1+Sum[Subscript[p,k]/n^k,{k,1,t}]);
mul=1;start=9; If[t>9,mul=n^(t-9);start=t];
w=Apart[Expand[mul*Simplify[
y[n]*n*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-((3*n-30)*y[n-11]
+(6*n-45)*y[n-10]*(n-10)
+(5*n+18)*y[n-9]*(n-9)*(n-10)
-(8*n-139)*y[n-8]*(n-8)*(n-9)*(n-10)
-(26*n-204)*y[n-7]*(n-7)*(n-8)*(n-9)*(n-10)
-(4*n-30)*y[n-6]*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(26*n-148)*y[n-5]*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(8*n-74)*y[n-4]*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-(9*n-18)*y[n-3]*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
-(2*n-15)*y[n-2]*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10)
+(n+2)*y[n-1]*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)*(n-6)*(n-7)*(n-8)*(n-9)*(n-10))],n],n];
sol=Solve[Table[Coefficient[w,n,j]==0,{j,start,start-t+1,-1}]];
asympt=y[n]/.sol[[1]];
Table[Denominator[Coefficient[asympt,n,-j]],{j,0,t}] (* Vaclav Kotesovec, Apr 06 2012 *)
Terms a(8)-a(25) from Vaclav Kotesovec, Apr 06 2012
A078628
Number of ways of arranging the numbers 1..n in a circle so that there is no consecutive triple i, i+1, i+2 or i, i-1, i-2 (mod n).
Original entry on oeis.org
1, 1, 0, 4, 12, 76, 494, 3662, 30574, 284398, 2918924, 32791604, 400400062, 5281683678, 74866857910, 1135063409918, 18330526475060, 314169905117860, 5695984717957246, 108921059813769710, 2190998123920252622, 46250325111346491694
Offset: 1
a(4) = 4: 4 2 1 3, 4 3 1 2, 4 1 3 2, 4 2 3 1.
a(5) = 12: 5 3 1 2 4, 5 2 3 1 4, 5 4 2 1 3, 5 2 4 1 3, 5 1 4 2 3, 5 2 1 4 3, 5 1 3 4 2, 5 3 1 4 2, 5 4 1 3 2, 5 3 4 1 2, 5 2 4 3 1, 5 3 2 4 1.
- Wayne M. Dymacek, Isaac Lambert and Kyle Parsons, Arithmetic Progressions in Permutations, http://math.ku.edu/~ilambert/CN.pdf, 2012. - From N. J. A. Sloane, Sep 14 2012
- Isaac Lambert, Table of n, a(n) for n = 1..50
- Wayne M. Dymáček and Isaac Lambert, Circular Permutations Avoiding Runs of i, i+1, i+2 or i, i-1, i-2, Journal of Integer Sequences, Vol. 14 (2011), Article 11.1.6.
- Sean A. Irvine, Java program (github)
- N. J. A. Sloane, FORTRAN program
- Index entries for sequences related to shoe lacings
A089222
Number of ways of seating n people around a table for the second time without anyone sitting next to the same person as they did the first time.
Original entry on oeis.org
1, 0, 0, 0, 0, 10, 36, 322, 2832, 27954, 299260, 3474482, 43546872, 586722162, 8463487844, 130214368530, 2129319003680, 36889393903794, 675098760648204, 13015877566642418, 263726707757115400, 5603148830577775218, 124568968969991162100, 2892414672938546871250
Offset: 0
Udi Hadad (somebody(AT)netvision.net.il), Dec 22 2003
a(4)=0 because trying to arrange 1,2,3,4 around a table will always give a couple who is sitting next to each other and differ by 1.
- J. Snell, Introduction to Probability, e-book, pp. 101 Q. 20.
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Art of Problem Solving forum, Random neighbors. - _Joel B. Lewis_, Jan 28 2010
- B. Aspvall and F. M. Liang, The dinner table problem, Technical Report CS-TR-80-829, Computer Science Department, Stanford, California, 1980.
- Charles M. Grinstead and J. Laurie Snell, Introduction to Probability.
- Vaclav Kotesovec, Non-attacking chess pieces, 6ed, 2013, p. 626.
- Roberto Tauraso, The Dinner Table Problem: The Rectangular Case, INTEGERS: Electronic Journal of Combinatorial Number Theory, Vol. 6 (2006), #A11. Note that in this paper a(1) = 1. See Column 2 in the table on page 3.
-
Same[cperm_, n_] := ( For[same = False; i = 2, (i <= n) && ! same, i++, same = ((Mod[cperm[[i - 1]], n] + 1) == cperm[[i]]) || ((Mod[cperm[[ i]], n] + 1) == cperm[[i - 1]])]; same = same || ((Mod[cperm[[n]], n] + 1) == cperm[[1]]) || ((Mod[ cperm[[1]], n] + 1) == cperm[[n]]); Return[same]); CntSame[n_] := (allPerms = Permutations[Range[n]]; count = 0; For[j = 1, j <= n!, j++, perm = allPerms[[j]]; If[ ! Same[perm, n], count++ ]]; Return[count]);
(* or direct computation of terms *)
Table[If[n<3, 0, n! + (-1)^n*2n + Sum[(-1)^r*(n/(n-r))^2 * (n-r)! * Sum[2^c * Binomial[r-1,c-1] * Binomial[n-r,c], {c,1,r}], {r,1,n-1}]], {n,1,25}] (* Vaclav Kotesovec, Apr 06 2012 *)
A326411
Triangle T(n,k) read by rows: T(n,k) = the number of ways of seating n people around a table for the second time so that k pairs are maintained. Reflected and rotated sequences are counted as one.
Original entry on oeis.org
1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 1, 1, 0, 5, 5, 0, 1, 3, 12, 15, 20, 9, 0, 1, 23, 70, 112, 91, 49, 14, 0, 1, 177, 544, 740, 640, 302, 96, 20, 0, 1, 1553, 4500, 6003, 4725, 2439, 747, 165, 27, 0, 1, 14963, 41740, 53585, 41420, 20810, 7076, 1550, 260, 35, 0, 1
Offset: 0
Assuming the initial order was {1,2,3,4,5} (therefore 1 and 5 form a pair as the first and last persons are neighbors in the case of a round table) there are 5 sets of ways of seating them again so that 3 pairs are conserved: {1,2,3,5,4}, {2,3,4,1,5}, {3,4,5,2,1}, {4,5,1,3,2}, {5,1,2,4,3}. Since within each set we do not allow for circular symmetry (e.g., {1,2,3,5,4} and its rotation to form {2,3,5,4,1} are counted as one) nor reflection ({1,2,3,5,4} and {4,5,3,2,1} are also counted as one), the total number of ways is 5 and therefore T(5,3)=5.
Unfolded table with n individuals (rows) forming k pairs (columns):
0 1 2 3 4 5 6 7
0 1
1 0 1
2 0 0 1
3 0 0 0 1
4 0 0 2 0 1
5 1 0 5 5 0 1
6 3 12 15 20 9 0 1
7 23 70 112 91 49 14 0 1
- Andrew Howroyd, Table of n, a(n) for n = 0..1325 (rows 0..50; rows 0..17 from Witold Tatkiewicz)
- P. Poulet, Query 4750, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Page 117)
- P. Poulet, Query 4750, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Pages 118, 119)
- P. Poulet, Query 4750, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Pages 120, 121)
- Witold Tatkiewicz, link for java program.
Row sums:
A001710(n-1) = Sum_k T(n,k).
Cf. also
A326390 (accounting for rotation and reflection symmetry),
A326397 (disregards reflection symmetry but allows rotation),
A326407 (disregards rotation symmetry but allows reflection).
-
See Links section
-
A326411 := proc(n,k)
option remember;
if k > n or k < 0 then
0;
elif k = n then
1;
elif k =0 then
if n < 5 then
0 ;
elif n = 5 then
1 ;
elif n = 6 then
3 ;
elif n = 7 then
23 ;
else
# Poulet eq (6) page 120, shifted n->n-2
-(n^3-8*n^2+18*n-21)*procname(n-1,0)
-4*(n^2-5*n)*procname(n-2,0)
+2*(n^3-11*n^2+33*n-18)*procname(n-3,0)
-(n^2-7*n+9)*procname(n-4,0)
-(n^3-10*n^2+28*n-15)*procname(n-5,0) ;
-%/(n^2-7*n+9) ;
end if;
elif n <= 3 then
0;
else
# Poulet eq (3) page 119
2*(n-k)*procname(n-1,k-1)/(n-1)+2*k*procname(n-1,k)/(n-1)
+(k-2)*procname(n-2,k-2)/(n-2) - 2*(k-1)*procname(n-2,k-1)/(n-2) + k*procname(n-2,k)/(n-2) ;
%*n/k ;
end if;
end proc:
for n from 0 to 12 do
for k from 0 to n do
printf("%a ",A326411(n,k)) ;
end do:
printf("\n") ;
end do: # R. J. Mathar, Mar 17 2022
-
T[n_, k_] := T[n, k] = Which[k > n || k < 0, 0, k == n, 1, k == 0, Which[n<5, 0, n == 5, 1, n == 6, 3, n == 7, 23, True,
pc = -(n^3 - 8*n^2 + 18*n - 21)*T[n-1, 0]
- 4*(n^2 - 5*n)*T[n - 2, 0]
+ 2*(n^3 - 11*n^2 + 33*n - 18)*T[n-3, 0]
- (n^2 - 7*n + 9)*T[n-4, 0]
- (n^3 - 10*n^2 + 28*n - 15)*T[n-5, 0];
-pc/(n^2 - 7*n + 9)], n <= 3, 0, True,
pc = 2*(n-k)*T[n-1, k-1]/(n-1) + 2*k*T[n-1, k]/(n-1) +
(k - 2)*T[n-2, k-2]/(n-2) -
2*(k-1)*T[n-2, k-1]/(n-2) + k*T[n-2, k]/(n-2);
pc*n/k];
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 17 2023, after R. J. Mathar *)
-
Q(n,k)={k*subst(serlaplace(polcoef((1 - 2*x -x^2)/((1 + x)*(1 + (1 - y)*x + y*x^2)) + O(x^n), n-1)), y, k)}
row(n)={Vec(if(n<3, 1, (Q(n,y/(y-1))/2 + (-1)^n)*(y-1)^n), -n-1)} \\ Andrew Howroyd, Mar 01 2024
A002493
Number of ways to arrange n non-attacking kings on an n X n board, with 2 sides identified to form a cylinder, with 1 in each row and column.
Original entry on oeis.org
1, 0, 0, 0, 10, 60, 462, 3920, 36954, 382740, 4327510, 53088888, 702756210, 9988248956, 151751644590, 2454798429600, 42130249479562, 764681923900260, 14636063499474054, 294639009867223880
Offset: 1
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Vincenzo Librandi, Table of n, a(n) for n = 1..100
- M. Abramson and W. O. J. Moser, Permutations without rising or falling w-sequences, Ann. Math. Stat., 38 (1967), 1245-1254.
- Eli Bagno, Estrella Eisenberg, Shulamit Reches, and Moriah Sigron, Counting King Permutations on the Cylinder, arXiv:2001.02948 [math.CO], 2020.
- Vaclav Kotesovec, Non-attacking chess pieces, 6ed, 2013, p. 627-8.
- A. J. Schwenk, Letter to N. J. A. Sloane, Mar 24 1980 (with enclosure and notes)
-
b1:= proc(n, r) local gu, x; if r=0 then RETURN(0): fi: gu := (x*diff(x*(1+x)/(1-x),x))* (x*(1 + x)/(1 - x))^(r-1); gu := taylor(gu, x = 0, n +1); coeff(gu, x, n ) end: b:=proc(n) local r: if n=1 then 1 elif n=2 then 0 else add((-1)^(n-r)*r!*b1(n,r),r=0..n): fi: end: # Doron Zeilberger, Nov 14 2007
-
b[n_]:=(If[n>0, n!+Sum[(-1)^r*(n-r)!*Sum[2^c*Binomial[r-1, c-1]*Binomial[n-r,c], {c, 1, r}], {r, 1, n-1}], 0]); Table[If[n>2, b[n]-2*Sum[b[n-1-2k], {k, 0, Floor[n/2]}], If[n==1, 1, 0]], {n, 1, 25}] (* Vaclav Kotesovec after Vladeta Jovovic, Apr 06 2012 *)
A231091
Number of distinct (modulo rotation) unicursal star polygons (not necessarily regular, no edge joins adjacent vertices) that can be formed by connecting the vertices of a regular n-gon.
Original entry on oeis.org
0, 0, 0, 0, 1, 1, 5, 27, 175, 1533, 14361, 151575, 1735869, 21594863, 289365383, 4158887007, 63822480809, 1041820050629, 18027531255745, 329658402237171, 6352776451924233, 128686951765990343, 2733851297673484765, 60781108703102022027, 1411481990523638719737
Offset: 1
For n=5, only solution is the regular pentagram.
For n=6, only solution is the unicursal hexagram (see Wikipedia link).
For n=7, two regular heptagrams and three irregular forms are possible.
-
\\ Requires a370068 from A370068, b(n) is A283184.
b(n)={subst(serlaplace(polcoef((1 - x)/(1 + (1 - 2*y)*x + 2*y*x^2) + O(x*x^n), n)), y, 1)}
a(n)={(if(n%2==0 && n > 2, b(n/2-1)/2) + a370068(n))/2} \\ Andrew Howroyd, Mar 01 2024
A078603
Number of ways of arranging the numbers 1..n in a circle so that adjacent numbers do not differ by 1 mod n.
Original entry on oeis.org
1, 0, 0, 0, 2, 6, 46, 354, 3106, 29926, 315862, 3628906, 45132474, 604534846, 8680957902, 133082437730, 2169964347282, 37505486702678, 685046187718022, 13186335387855770, 266816610979894058, 5662225862272325550
Offset: 1
a(5) = 2: 1 3 5 2 4, 1 4 2 5 3; a(6) = 6: 1 4 6 2 5 3, 1 5 2 4 6 3, 1 5 3 6 2 4, 1 3 6 4 2 5, 1 4 2 6 3 5, 1 3 5 2 6 4.
The sequence was missing a zero; also added a cross-reference
Joel B. Lewis, Jan 28 2010
A370459
Number of unicursal stars with n vertices.
Original entry on oeis.org
0, 0, 1, 1, 5, 19, 112, 828, 7441, 76579, 871225, 10809051, 144730446, 2079635889, 31912025537, 520913578812, 9013780062785, 164829273635749, 3176388519597555, 64343477504391475, 1366925655386979893, 30390554390984325019, 705740995420852895453
Offset: 3
For n=5, there is only the regular pentagram {5/2}.
For n=6, there is only the unicursal hexagram.
For n=7, in addition to the two regular heptagrams {7/2} and {7/3}, there are three nontrivial unicursal heptagrams represented by:
(0, 2, 4, 1, 6, 3, 5, 0)
(0, 2, 5, 1, 3, 6, 4, 0)
(0, 2, 5, 1, 4, 6, 3, 0).
Cf.
A000940 (polygon sides allowed).
Cf.
A055684 (cases with dihedral symmetry only).
Cf.
A002816 (rotations and reflections counted separately).
-
\\ Requires a370068 from A370068.
Ro(n)=-(-1)^n + subst(serlaplace(polcoef(((1 - x)^2)/(2*(1 + x)*(1 + (1 - 2*y)*x + 2*y*x^2)) + O(x*x^n), n)), y, 1)
Re(n)=subst(serlaplace(polcoef((1 - x - 2*x^2)/(4*(1 + (1 - 2*y)*x + 2*y*x^2)) + O(x*x^n), n)), y, 1)
a(n)={if(n<3, 0, (if(n%2, 2*Ro(n\2), Re(n/2)) + a370068(n))/4)} \\ Andrew Howroyd, Mar 01 2024
Showing 1-9 of 9 results.
Comments