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.

Showing 1-2 of 2 results.

A114209 Number of permutations of [n] having exactly two fixed points and avoiding the patterns 123 and 231.

Original entry on oeis.org

0, 1, 0, 2, 1, 3, 2, 5, 3, 7, 5, 9, 7, 12, 9, 15, 12, 18, 15, 22, 18, 26, 22, 30, 26, 35, 30, 40, 35, 45, 40, 51, 45, 57, 51, 63, 57, 70, 63, 77, 70, 84, 77, 92, 84, 100, 92, 108, 100, 117, 108, 126, 117, 135, 126, 145, 135, 155, 145, 165, 155, 176, 165, 187, 176, 198, 187
Offset: 1

Views

Author

Emeric Deutsch, Nov 17 2005

Keywords

Examples

			a(2)=1 because we have 12; a(3)=0 because no permutation of [3] can have exactly two fixed points; a(4)=2 because we have 1432 and 3214.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 6 = 0 then n*(n+6)/24 elif n mod 6 = 1 or n mod 6 = 5 then (n^2-1)/24 elif n mod 6 = 2 or n mod 6 = 4 then (n+2)*(n+4)/24 else (n^2-9)/24 fi end: seq(a(n),n=1..70);

Formula

a(n) = n(n+6)/24 if n mod 6 = 0; (n^2-1)/24 if n mod 6 = 1 or 5; (n+2)(n+4)/24 if n mod 6 = 2 or 4; (n^2-9)/24 if n mod 6 = 3.
a(n) = A008731(n-2). O.g.f.: x^2/((1-x)^3(1+x)^2(1+x+x^2)). [R. J. Mathar, Aug 11 2008]

A114210 Number of derangements of [n] avoiding the patterns 123 and 231.

Original entry on oeis.org

0, 1, 1, 3, 4, 7, 8, 14, 13, 23, 20, 34, 28, 48, 37, 64, 48, 82, 60, 103, 73, 126, 88, 151, 104, 179, 121, 209, 140, 241, 160, 276, 181, 313, 204, 352, 228, 394, 253, 438, 280, 484, 308, 533, 337, 584, 368, 637, 400, 693, 433, 751, 468, 811, 504, 874, 541, 939
Offset: 1

Views

Author

Emeric Deutsch, Nov 17 2005

Keywords

Examples

			a(2)=1 because we have 21; a(3)=1 because we have 312; a(4)=3 because we have 2143, 4312 and 4321.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 6 = 0 then (7*n^2-18*n+24)/24 elif n mod 6 = 1 or n mod 6 = 5 then (n^2-1)/6 elif n mod 6 = 2 or n mod 6 = 4 then (7*n^2-18*n+32)/24 else (n^2-3)/6 fi end: seq(a(n),n=1..70);
  • Mathematica
    LinearRecurrence[{-1,2,3,0,-3,-2,1,1},{0,1,1,3,4,7,8,14},60] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    Vec(-x^2*(x^6+x^5+2*x^4+2*x^3+2*x^2+2*x+1)/((x-1)^3*(x+1)^3*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Aug 14 2013

Formula

a(n) = binomial(n,2) + 1 - A114208(n) - A114209(n)
a(n) = (7n^2-18n+24)/24 if n mod 6 = 0; (n^2-1)/6 if n mod 6 = 1 or 5; (7n^2-18n+32)/24 if n mod 6 = 2 or 4; (n^2-3)/6 if n mod 6 = 3.
G.f.: -x^2*(x^6+x^5+2*x^4+2*x^3+2*x^2+2*x+1) / ((x-1)^3*(x+1)^3*(x^2+x+1)). - Colin Barker, Aug 14 2013
Showing 1-2 of 2 results.