Original entry on oeis.org
1, 1, 4, 6, 36, 72, 576, 1440, 14400, 43200, 518400, 1814400, 25401600, 101606400, 1625702400, 7315660800, 131681894400, 658409472000, 13168189440000, 72425041920000, 1593350922240000, 9560105533440000, 229442532802560000, 1491376463216640000, 38775788043632640000
Offset: 2
A002620
Quarter-squares: a(n) = floor(n/2)*ceiling(n/2). Equivalently, a(n) = floor(n^2/4).
Original entry on oeis.org
0, 0, 1, 2, 4, 6, 9, 12, 16, 20, 25, 30, 36, 42, 49, 56, 64, 72, 81, 90, 100, 110, 121, 132, 144, 156, 169, 182, 196, 210, 225, 240, 256, 272, 289, 306, 324, 342, 361, 380, 400, 420, 441, 462, 484, 506, 529, 552, 576, 600, 625, 650, 676, 702, 729, 756, 784, 812
Offset: 0
a(3) = 2, floor(3/2)*ceiling(3/2) = 2.
[ n] a(n)
---------
[ 2] 1
[ 3] 2
[ 4] 1 + 3
[ 5] 2 + 4
[ 6] 1 + 3 + 5
[ 7] 2 + 4 + 6
[ 8] 1 + 3 + 5 + 7
[ 9] 2 + 4 + 6 + 8
From _Wolfdieter Lang_, Dec 09 2014: (Start)
Tiling of a triangular shape T_N, N >= 1 with rectangles:
N=5, n=6: a(6) = 9 because all the rectangles (i, j) (modulo transposition, i.e., interchange of i and j) which are of use are:
(5, 1) ; (1, 1)
(4, 2), (4, 1) ; (2, 2), (2, 1)
; (3, 3), (3, 2), (3, 1)
That is (1+1) + (2+2) + 3 = 9 = a(6). Partial sums of 1, 1, 2, 2, 3, ... (A004526). (End)
Bisymmetric matrices B: 2 X 2, a(3) = 2 from B[1,1] and B[1,2]. 3 X 3, a(4) = 4 from B[1,1], B[1,2], B[1,3], and B[2,2]. - _Wolfdieter Lang_, Jul 07 2015
From _John M. Campbell_, Jan 29 2016: (Start)
Letting n=5, there are a(n)=a(5)=6 partitions of 2n+1=11 of length three with exactly two even entries:
(8,2,1) |- 2n+1
(7,2,2) |- 2n+1
(6,4,1) |- 2n+1
(6,3,2) |- 2n+1
(5,4,2) |- 2n+1
(4,4,3) |- 2n+1
(End)
From _Aaron Khan_, Jul 13 2022: (Start)
Examples of the sequence when used for rooks on a chessboard:
.
A solution illustrating a(5)=4:
+---------+
| B B . . |
| B B . . |
| . . W W |
| . . W W |
+---------+
.
A solution illustrating a(6)=6:
+-----------+
| B B . . . |
| B B . . . |
| B B . . . |
| . . W W W |
| . . W W W |
+-----------+
(End)
- Sergei Abramovich, Combinatorics of the Triangle Inequality: From Straws to Experimental Mathematics for Teachers, Spreadsheets in Education (eJSiE), Vol. 9, Issue 1, Article 1, 2016. See Fig. 3.
- G. L. Alexanderson et al., The William Powell Putnam Mathematical Competition - Problems and Solutions: 1965-1984, M.A.A., 1985; see Problem A-1 of 27th Competition.
- T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 73, problem 25.
- Michael Doob, The Canadian Mathematical Olympiad -- L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society -- Société Mathématique du Canada, Problème 9, 1970, pp 22-23, 1993.
- H. J. Finck, On the chromatic numbers of a graph and its complement. Theory of Graphs (Proc. Colloq., Tihany, 1966) Academic Press, New York (1968), 99-113.
- R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 99.
- D. E. Knuth, The art of programming, Vol. 1, 3rd Edition, Addison-Wesley, 1997, Ex. 36 of section 1.2.4.
- J. Nelder, Critical sets in Latin squares, CSIRO Division of Math. and Stats. Newsletter, Vol. 38 (1977), p. 4.
- 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).
- Franklin T. Adams-Watters, Table of n, a(n) for n = 0..10000
- Akbar Ali, A survey of antiregular graphs, Contrib. Math. 1 (2020), 67-79.
- Suayb S. Arslan, Asymptotically MDS Array BP-XOR Codes, arXiv:1709.07949 [cs.IT], 2017.
- Nicolay Avilov, Illustration of the sequence.
- J. A. Bate and G. H. J. van Rees, The Size of the Smallest Strong Critical Set in a Latin Square, Ars Combinatoria, Vol. 53 (1999) 73-83.
- M. Benoumhani and M. Kolli, Finite topologies and partitions, JIS, Vol. 13 (2010), Article 10.3.5, Lemma 6 first line.
- Allan Bickle, Nordhaus-Gaddum Theorems for k-Decompositions, Congr. Num., Vol. 211 (2012), pp. 171-183.
- Allan Bickle, Extremal Decompositions for Nordhaus-Gaddum Theorems, Discrete Math, 346 7 (2023), 113392.
- G. Blom and C.-E. Froeberg, Om myntvaexling (On money-changing) [Swedish], Nordisk Matematisk Tidskrift, Vol. 10 (1962), pp. 55-69, 103. [Annotated scanned copy] See Table 4, row 3.
- Washington G. Bomfim, Illustration of the bracelets with 8 beads, 2 of which are red, 1 of which is blue.
- Henry Bottomley, Illustration of initial terms.
- J. Brandts and C. Cihangir, Counting triangles that share their vertices with the unit n-cube, in Conference Applications of Mathematics 2013 in honor of the 70th birthday of Karel Segeth. Jan Brandts, Sergey Korotov, et al., eds., Institute of Mathematics AS CR, Prague 2013.
- Jan Brandts and A Cihangir, Enumeration and investigation of acute 0/1-simplices modulo the action of the hyperoctahedral group, arXiv preprint arXiv:1512.03044 [math.CO], 2015.
- P. J. Cameron, BCC Problem List, Problem BCC15.15 (DM285), Discrete Math., Vol. 167/168 (1997), pp. 605-615.
- P. J. Cameron, Sequences realized by oligomorphic permutation groups, J. Integ. Seq., Vol. 3 (2000), Article 00.1.5.
- Johann Cigler, Some remarks on Rogers-Szegö polynomials and Losanitsch's triangle, arXiv:1711.03340 [math.CO], 2017.
- H. de Alba, W. Carballosa, J. Leaños, and L. M. Rivera, Independence and matching numbers of some token graphs Australas. J. Combin. 76(3) (2020), 387-403.
- F. Javier de Vega, An extension of Furstenberg's theorem of the infinitude of primes, arXiv:2003.13378 [math.NT], 2020.
- Bakir Farhi, On the Representation of the Natural Numbers as the Sum of Three Terms of the Sequence floor(n^2/a), Journal of Integer Sequences, Vol. 16 (2013), Article 13.6.4.
- E. Fix and J. L. Hodges, Jr., Significance probabilities of the Wilcoxon test, Annals Math. Stat., Vol. 26 (1955), pp. 301-312.
- E. Fix and J. L. Hodges, Significance probabilities of the Wilcoxon test, Annals Math. Stat., Vol. 26 (1955), pp. 301-312. [Annotated scanned copy]
- A. Ganesan, Automorphism groups of graphs, arXiv preprint arXiv:1206.6279 [cs.DM], 2012. - From _N. J. A. Sloane_, Dec 17 2012
- Juan B. Gil and Jessica A. Tomasko, Pattern-avoiding even and odd Grassmannian permutations, arXiv:2207.12617 [math.CO], 2022.
- J. W. L. Glaisher and G. Carey Foster, The Method of Quarter Squares, Journal of the Institute of Actuaries, Vol. 28, No. 3, January, 1890, pp. 227-235.
- E. Gottlieb and M. Sheard, An Erdős-Szekeres result for set partitions, Slides from a talk, Nov 14 2014. [A006260 is a typo for A002620]
- R. K. Guy, Letters to N. J. A. Sloane, June-August 1968
- Phillip Tomas Heikoop, Dimensions of Matrix Subalgebras, Bachelor's Thesis, Worcester Polytechnic Institute (Massachusetts, 2019).
- Andreas M. Hinz and Paul K. Stockmeyer, Precious Metal Sequences and Sierpinski-Type Graphs, J. Integer Seq., Vol 25 (2022), Article 22.4.8.
- T. Huber, N. Mayes, J. Opoku, and D. Ye, Ramanujan type congruences for quotients of Klein forms, Journal of Number Theory, 258, 281-333, (2024). See Corollary 2.5 page 11.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 36.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 105
- O. A. Ivanov, On the number of regions into which n straight lines divide the plane, Amer. Math. Monthly, 117 (2010), 881-888. See Th. 4.
- T. Jenkyns and E. Muller, Triangular triples from ceilings to floors, Amer. Math. Monthly, Vol. 107 (Aug. 2000), pp. 634-639.
- Paloma Jiménez-Sepúlveda and Luis Manuel Rivera, Independence numbers of some double vertex graphs and pair graphs, arXiv:1810.06354 [math.CO], 2018.
- V. Jovovic, Vladeta Jovovic, Number of binary matrices.
- Clark Kimberling and John E. Brown, Partial Complements and Transposable Dispersions, J. Integer Seq., Vol. 7 (2004), Article 04.1.6.
- Jukka Kohonen, Counting graded lattices of rank three that have few coatoms, arXiv:1804.03679 [math.CO], 2018.
- S. Lafortune, A. Ramani, B. Grammaticos, Y. Ohta and K.M. Tamizhmani, Blending two discrete integrability criteria: ..., arXiv:nlin/0104020 [nlin.SI], 2001.
- W. Lanssens, B. Demoen and P.-L. Nguyen, The Diagonal Latin Tableau and the Redundancy of its Disequalities, Report CW 666, July 2014, Department of Computer Science, KU Leuven.
- S. M. Losanitsch, Die Isomerie-Arten bei den Homologen der Paraffin-Reihe, Chem. Ber., Vol. 30 (1897), pp. 1917-1926.
- S. M. Losanitsch, Die Isomerie-Arten bei den Homologen der Paraffin-Reihe, Chem. Ber., Vol. 30 (1897), pp. 1917-1926. (Annotated scanned copy)
- W. Mantel and W. A. Wythoff, Vraagstuk XXVIII, Wiskundige Opgaven, Vol. 10 (1907), pp. 60-61.
- Rene Marczinzik, Finitistic Auslander algebras, arXiv:1701.00972 [math.RT], 2017 [Page 9, Conjecture].
- Mircea Merca, Inequalities and Identities Involving Sums of Integer Functions, J. Integer Sequences, Vol. 14 (2011), Article 11.9.1.
- Emanuele Munarini, Topological indices for the antiregular graphs, Le Mathematiche, Vol. 76, No. 1 (2021), pp. 277-310, see page 282.
- Mohammed L. Nadji, Moussa Ahmia, Daniel F. Checa, and José L. Ramírez, Arndt Compositions with Restricted Parts, Palindromes, and Colored Variants, J. Int. Seq. (2025) Vol. 28, Issue 3, Article 25.3.6. See p. 11.
- Kival Ngaokrajang, Illustration of twin hearts patterns (6c4c): T, U, V.
- E. A. Nordhaus and J. Gaddum, On complementary graphs, Amer. Math. Monthly, Vol. 63 (1956), pp. 175-177.
- Brian O'Sullivan and Thomas Busch, Spontaneous emission in ultra-cold spin-polarised anisotropic Fermi seas, arXiv:0810.0231v1 [quant-ph], 2008. [Eq 8a, lambda=2]
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009;
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992.
- N. Reading, Order Dimension, Strong Bruhat Order and Lattice Properties for Posets
- N. Reading, Order Dimension, Strong Bruhat Order and Lattice Properties for Posets, Order, Vol. 19, No. 1 (2002), pp. 73-100.
- Denis Roegel, A reconstruction of Blater's table of quarter-squares (1887), Locomat Project, 6 November 2013.
- J. Scholes, 27th Putnam 1966 Prob. A1.
- N. J. A. Sloane, Classic Sequences.
- Sam E. Speed, The Integer Sequence A002620 and Upper Antagonistic Functions, Journal of Integer Sequences, Vol. 6 (2003), Article 03.1.4.
- K. E. Stange, Integral points on elliptic curves and explicit valuations of division polynomials arXiv:1108.3051v3 [math.NT], 2011-2014.
- Eric Weisstein's World of Mathematics, Black Bishop Graph.
- Eric Weisstein's World of Mathematics, Complete Bipartite Graph.
- Eric Weisstein's World of Mathematics, Graph Crossing Number.
- Eric Weisstein's World of Mathematics, Lower Matching Number.
- Eric Weisstein's World of Mathematics, Matching Number.
- Eric Weisstein's World of Mathematics, Triangular Honeycomb Rook Graph.
- Thomas Wieder, The number of certain k-combinations of an n-set, Applied Mathematics Electronic Notes, Vol. 8 (2008), pp. 45-52.
- Wikipedia, Bisymmetric Matrix.
- Index entries for two-way infinite sequences.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
- Index entries for "core" sequences.
A087811 is another version of this sequence.
Cf.
A024206,
A072280,
A002984,
A007590,
A000212,
A118015,
A056827,
A118013,
A128174,
A000601,
A115514,
A189151,
A063657,
A171608,
A005044,
A030179,
A275437,
A004526.
Antidiagonal sums of array
A003983.
Elliptic troublemaker sequences:
A000212 (= R_n(1,3) = R_n(2,3)),
A007590 (= R_n(2,4)),
A030511 (= R_n(2,6) = R_n(4,6)),
A033436 (= R_n(1,4) = R_n(3,4)),
A033437 (= R_n(1,5) = R_n(4,5)),
A033438 (= R_n(1,6) = R_n(5,6)),
A033439 (= R_n(1,7) = R_n(6,7)),
A184535 (= R_n(2,5) = R_n(3,5)).
Cf.
A250000 (queens on a chessboard),
A176222 (kings on a chessboard),
A355509 (knights on a chessboard).
-
# using the formula by Paul Barry
A002620 := List([1..10^4], n-> (2*n^2 - 1 + (-1)^n)/8); # Muniru A Asiru, Feb 01 2018
-
a002620 = (`div` 4) . (^ 2) -- Reinhard Zumkeller, Feb 24 2012
-
[ Floor(n/2)*Ceiling(n/2) : n in [0..40]];
-
A002620 := n->floor(n^2/4); G002620 := series(x^2/((1-x)^2*(1-x^2)),x,60);
with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=1)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m),m=0..57) ; # Zerinvary Lajos, Mar 09 2007
-
Table[Ceiling[n/2] Floor[n/2], {n, 0, 56}] (* Robert G. Wilson v, Jun 18 2005 *)
LinearRecurrence[{2, 0, -2, 1}, {0, 0, 1, 2}, 60] (* Harvey P. Dale, Oct 05 2012 *)
Table[Floor[n^2/4], {n, 0, 20}] (* Eric W. Weisstein, Sep 11 2018 *)
Floor[Range[0, 20]^2/4] (* Eric W. Weisstein, Sep 11 2018 *)
CoefficientList[Series[-(x^2/((-1 + x)^3 (1 + x))), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 11 2018 *)
Table[Floor[n^2/2]/2, {n, 0, 56}] (* Clark Kimberling, Dec 05 2021 *)
-
makelist(floor(n^2/4),n,0,50); /* Martin Ettl, Oct 17 2012 */
-
a(n)=n^2\4
-
(t(n)=n*(n+1)/2);for(i=1,50,print1(",",(-1)^i*sum(k=1,i,(-1)^k*t(k))))
-
a(n)=n^2>>2 \\ Charles R Greathouse IV, Nov 11 2009
-
x='x+O('x^100); concat([0, 0], Vec(x^2/((1-x)^2*(1-x^2)))) \\ Altug Alkan, Oct 15 2015
-
def A002620(n): return (n**2)>>2 # Chai Wah Wu, Jul 07 2022
-
def A002620():
x, y = 0, 1
yield x
while true:
yield x
x, y = x + y, x//y + 1
a = A002620(); print([next(a) for i in range(58)]) # Peter Luschny, Dec 17 2015
A152877
Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k consecutive triples of the form (odd,even,odd) and (even,odd,even) (0<=k<=n-2).
Original entry on oeis.org
1, 1, 2, 4, 2, 16, 0, 8, 60, 24, 24, 12, 288, 144, 216, 0, 72, 1584, 1296, 1152, 576, 288, 144, 10368, 9216, 10368, 4608, 4608, 0, 1152, 74880, 83520, 86400, 60480, 31680, 17280, 5760, 2880, 604800, 748800, 892800, 576000, 460800, 172800, 144000, 0, 28800
Offset: 0
T(3,1) = 2 because we have 123 and 321.
Triangle starts:
1;
1;
2;
4, 2;
16, 0, 8;
60, 24, 24, 12;
288, 144, 216, 0, 72;
1584, 1296, 1152, 576, 288, 144;
10368, 9216, 10368, 4608, 4608, 0, 1152;
...
-
b:= proc(o, u, t) option remember; `if`(u+o=0, 1, expand(
o*b(o-1, u, [2, 2, 5, 5, 2][t])*`if`(t=4, x, 1)+
u*b(o, u-1, [3, 4, 3, 3, 4][t])*`if`(t=5, x, 1)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
b(ceil(n/2), floor(n/2), 1)):
seq(T(n), n=0..12); # Alois P. Heinz, Nov 10 2013
-
b[o_, u_, t_] := b[o, u, t] = If[u+o == 0, 1, Expand[o*b[o-1, u, {2, 2, 5, 5, 2}[[t]]]*If[t == 4, x, 1] + u*b[o, u-1, {3, 4, 3, 3, 4}[[t]]]*If[t == 5, x, 1]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]] [b[Ceiling[n/2], Floor[n/2], 1]]; Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, May 27 2015, after Alois P. Heinz *)
A125300
Tanimoto triangle read by rows: T(n,k) = number of "parity-alternating permutations" (PAPS) of n symbols with k ascents.
Original entry on oeis.org
1, 1, 1, 1, 0, 1, 1, 3, 3, 1, 1, 2, 6, 2, 1, 1, 9, 26, 26, 9, 1, 1, 8, 39, 48, 39, 8, 1, 1, 23, 165, 387, 387, 165, 23, 1, 1, 22, 228, 674, 1030, 674, 228, 22, 1, 1, 53, 860, 4292, 9194, 9194, 4292, 860, 53, 1, 1, 52, 1149, 7136, 20738, 28248, 20738, 7136, 1149, 52, 1
Offset: 1
Triangle begins:
n=1.|.1
n=2.|.1....1
n=3.|.1....0....1
n=4.|.1....3....3....1
n=5.|.1....2....6....2....1
n=6.|.1....9...26...26....9....1
n=7.|.1....8...39...48...39....8....1
n=8.|.1...23..165..387..387..165...23....1
n=9.|.1...22..228..674.1030..674..228...22....1
n=10|.1...53..860.4292.9194.9194.4292..860...53....1
Examples of parity-alternating permutations of n=5 and their number of rises k are [1,2,3,4,5] (k=4, only rises), [1,2,5,4,3] (k=2: 1->2 and 2->5), [1,4,3,2,5] (k=2: 1->4 and 2->5). The T(n=5,k=1)=2 parity-alternating permutations with k=1 rise are [3,2,5,4,1] and [5,2,1,4,3].
Cf.
A008292 = Triangle of Eulerian numbers T(n, k) read by rows,
A049061 = Triangle a(n, k) (1<=k<=n) of signed Eulerian numbers.
-
isPAP := proc(per) local i ; for i from 2 to nops(per) do if ( op(i,per) mod 2 ) = (op(i-1,per) mod 2 ) then RETURN(false) ; fi ; od : RETURN(true) ; end: ascents := proc(per) local i, asc ; asc :=0 ; for i from 2 to nops(per) do if op(i,per) > op (i-1,per) then asc := asc+1 : fi ; od : RETURN(asc) ; end:
A125300row := proc(n) local per,resul, asc,thisp,p,i,row ; row := array(0..n-1) ; for i from 0 to n-1 do row[i] := 0 : od ; per := combinat[permute](n) ; for p from 1 to nops(per) do asc := 0 ; thisp := op(p,per) ; if isPAP(thisp) then asc := ascents(thisp) ; row[asc] := row[asc]+1 ; fi ; od ; RETURN(row) : end: for n from 2 to 10 do r := A125300row(n) ; for k from 0 to n-1 do print(r[k]) ; od : od : # R. J. Mathar, Dec 12 2006
-
isPAP[per_] := (For[i = 2, i <= Length[per], i++, If [Mod[per[[i]], 2] == Mod[per[[i - 1]], 2], Return[False] ] ]; True);
ascents[per_] := (asc = 0; For[i = 2, i <= Length[per], i++, If[per[[i]] > per[[i - 1]], asc ++] ]; asc);
A125300row[n_] := (row = Range[0, n - 1]; For[i = 0, i <= n - 1, i++, row[[i]] = 0]; per = Permutations[Range[n]]; For[p = 1, p <= Length[per], p++, asc = 0; thisp = per[[p]]; If[isPAP[thisp], asc = ascents[thisp]; row[[asc]] += 1]]; row);
Join[{1}, Reap[For[n = 2, n <= 10, n++, r = A125300row[n]; For[k = 0, k <= n - 1, k++, Print[r[[k]]]; Sow[r[[k]]]]]][[2, 1]]] (* Jean-François Alcover, Nov 07 2017, after R. J. Mathar's Maple code *)
Replaced arXiv URL by non-cached version -
R. J. Mathar, Oct 30 2009
A152874
Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} with k parity changes (n>=2; 1<=k <=n-1); the permutation 372185946 has 5 parity changes: 37-2-1-8-59-46.
Original entry on oeis.org
2, 4, 2, 8, 8, 8, 24, 36, 48, 12, 72, 144, 288, 144, 72, 288, 720, 1728, 1296, 864, 144, 1152, 3456, 10368, 10368, 10368, 3456, 1152, 5760, 20160, 69120, 86400, 103680, 51840, 23040, 2880, 28800, 115200, 460800, 691200, 1036800, 691200, 460800, 115200, 28800
Offset: 2
T(4,3) = 8 because we have 1243, 1423, 4132, 4312, 2134, 2314, 3241 and 3421.
Triangle starts:
2;
4, 2;
8, 8, 8;
24, 36, 48, 12;
72, 144, 288, 144, 72;
...
-
ae := proc (n, k) if `mod`(k, 2) = 0 then 2*factorial(n)^2*binomial(n-1, (1/2)*k-1)*binomial(n-1, (1/2)*k) else 2*factorial(n)^2*binomial(n-1, (1/2)*k-1/2)^2 end if end proc: ao := proc (n, k) if `mod`(k, 2) = 0 then factorial(n)*factorial(n+1)*(binomial(n, (1/2)*k)*binomial(n-1, (1/2)*k-1)+binomial(n, (1/2)*k-1)*binomial(n-1, (1/2)*k)) else 2*factorial(n)*factorial(n+1)*binomial(n, (1/2)*k-1/2)*binomial(n-1, (1/2)*k-1/2) end if end proc: T := proc (n, k) if `mod`(n, 2) = 0 then ae((1/2)*n, k) else ao((1/2)*n-1/2, k) end if end proc: for n from 2 to 10 do seq(T(n, k), k = 1 .. n-1) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(x, y, t) option remember; `if`(x+y=0, 1, `if`(x>0,
b(x-1, y, z)*x, 0)+`if`(y>0, expand(b(y-1, x, z)*y*t), 0))
end:
T:= n-> (h-> (p-> seq(coeff(p, z, i), i=1..n-1))(b(h, n-h, 1)))(iquo(n, 2)):
seq(T(n), n=2..12); # Alois P. Heinz, May 23 2023
-
b[x_, y_, t_] := b[x, y, t] = If[x + y == 0, 1, If[x > 0, b[x - 1, y, z]*x, 0] + If[y > 0, Expand[b[y - 1, x, z]*y*t], 0]];
T[n_] := Table[Coefficient[#, z, i], {i, 1, n-1}]&[b[#, n-#, 1]]&[ Quotient[n, 2]];
Table[T[n], {n, 2, 12}] // Flatten (* Jean-François Alcover, Aug 16 2023, after Alois P. Heinz *)
A062870
Number of permutations of degree n with greatest sum of distances.
Original entry on oeis.org
1, 1, 1, 3, 4, 20, 36, 252, 576, 5184, 14400, 158400, 518400, 6739200, 25401600, 381024000, 1625702400, 27636940800, 131681894400, 2501955993600, 13168189440000, 276531978240000, 1593350922240000, 36647071211520000, 229442532802560000, 5736063320064000000
Offset: 0
(4,3,1,2) has distances (3,1,2,2), sum is 8 and there are 3 other permutations of degree 4 {3, 4, 1, 2}, {3, 4, 2, 1}, {4, 3, 2, 1} with this sum which is the maximum possible.
-
a:= proc(n) option remember; `if`(n<2, 1+n*(n-1),
(n*((n-1)^2*(3*n-4)*a(n-2)-4*a(n-1)))/(4*(n-1)*(3*n-7)))
end:
seq(a(n), n=0..30); # Alois P. Heinz, Jan 16 2014
-
a[n_?EvenQ] := (n/2)!^2; a[n_?OddQ] := n*((n-1)/2)!^2; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 15 2015 *)
-
for(k=0,20,print1((2*k+1)*k!^2","(k+1)!^2",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007
A363236
Number of permutations p of [n] such that each element in p has at least one neighbor with opposite parity.
Original entry on oeis.org
1, 0, 2, 2, 16, 36, 288, 1152, 10368, 57600, 604800, 4320000, 51840000, 453600000, 6147187200, 63605606400, 962415820800, 11500218777600, 192255565824000, 2605984690176000, 47721518530560000, 723526168780800000, 14407079038894080000, 241602987041095680000
Offset: 0
a(0) = 1: (), the empty permutation.
a(1) = 0.
a(2) = 2: 12, 21.
a(3) = 2: 123, 321.
a(4) = 16: 1234, 1243, 1423, 1432, 2134, 2143, 2314, 2341, 3214, 3241, 3412, 3421, 4123, 4132, 4312, 4321.
a(5) = 36: 12345, 12354, 12534, 12543, 14325, 14352, 14523, 14532, 21345, 21543, 23145, 23541, 25143, 25341, 32145, 32154, 32514, 32541, 34125, 34152, 34512, 34521, 41325, 41523, 43125, 43521, 45123, 45321, 52134, 52143, 52314, 52341, 54123, 54132, 54312, 54321.
A232187
Number T(n,k) of parity alternating permutations of [n] with exactly k descents from odd to even numbers; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/2)), read by rows.
Original entry on oeis.org
1, 1, 2, 1, 1, 5, 3, 2, 8, 2, 20, 44, 8, 6, 66, 66, 6, 114, 594, 414, 30, 24, 624, 1584, 624, 24, 864, 8784, 14544, 4464, 144, 120, 6840, 36240, 36240, 6840, 120, 8280, 147720, 471120, 353520, 55320, 840, 720, 86400, 857520, 1739520, 857520, 86400, 720, 96480
Offset: 0
T(5,0) = 2: 12345, 34125.
T(5,1) = 8: 12543, 14325, 14523, 32145, 34521, 52143, 52341, 54123.
T(5,2) = 2: 32541, 54321.
T(6,2) = 8: 163254, 165432, 321654, 325416, 541632, 543216, 632541, 654321.
T(7,0) = 6: 1234567, 1256347, 3412567, 3456127, 5612347, 5634127.
T(7,1) = 66: 1234765, 1236547, 1236745, ..., 7456123, 7612345, 7634125.
T(7,2) = 66: 1254763, 1276543, 1432765, ..., 7652143, 7652341, 7654123.
T(7,3) = 6: 3254761, 3276541, 5432761, 5476321, 7632541, 7654321.
Triangle T(n,k) begins:
: 0 : 1;
: 1 : 1;
: 2 : 2;
: 3 : 1, 1;
: 4 : 5, 3;
: 5 : 2, 8, 2;
: 6 : 20, 44, 8;
: 7 : 6, 66, 66, 6;
: 8 : 114, 594, 414, 30;
: 9 : 24, 624, 1584, 624, 24;
: 10 : 864, 8784, 14544, 4464, 144;
: 11 : 120, 6840, 36240, 36240, 6840, 120;
A152660
Triangle read by rows: T(n,k) is the number of permutations of [n] for which k is the maximal number of initial entries whose parities alternate (1 <= k <= n).
Original entry on oeis.org
1, 0, 2, 2, 2, 2, 8, 8, 0, 8, 48, 36, 12, 12, 12, 288, 216, 72, 72, 0, 72, 2160, 1440, 576, 432, 144, 144, 144, 17280, 11520, 4608, 3456, 1152, 1152, 0, 1152, 161280, 100800, 43200, 28800, 11520, 8640, 2880, 2880, 2880, 1612800, 1008000, 432000, 288000, 115200, 86400, 28800, 28800, 0, 28800
Offset: 1
T(4,2)=8 because we have 1243, 1423, 2134, 2314, 3241, 3421, 4132 and 4312.
Triangle starts:
1;
0, 2;
2, 2, 2;
8, 8, 0, 8;
48, 36, 12, 12, 12;
288, 216, 72, 72, 0, 72;
-
T := proc (n, k) if n < k then 0 elif `mod`(n, 2) = 0 and `mod`(k, 2) = 0 then 2*factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-(1/2)*k) elif `mod`(n, 2) = 0 and `mod`(k, 2) = 1 then 2*factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-(1/2)*k+1/2) elif `mod`(n, 2) = 1 and `mod`(k, 2) = 0 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k, (1/2)*n-(1/2)*k-1/2) elif `mod`(n, 2) = 1 and k = n then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k, (1/2)*n-(1/2)*k-1) end if end proc: for n to 10 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form
-
T[n0_?EvenQ, k_] := With[{n = n0/2}, 2 (n!)^2*Binomial[2 n - k - 1, n - Floor[k/2]]];
T[n1_?OddQ, k0_?EvenQ] := With[{n = (n1 - 1)/2, k = k0/2}, n! (n + 1)! * Binomial[2 n - 2 k + 1, n - k] ];
T[n1_?OddQ, k1_?OddQ] := With[{n = (n1 - 1)/2, k = (k1 - 1)/2}, n! (n+1)! * Binomial[2 n - 2 k, n - k - 1] ];
T[n1_?OddQ, n1_?OddQ] := With[{n = (n1 - 1)/2}, n! (n + 1)!];
Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 28 2017 *)
Showing 1-9 of 9 results.
Comments