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-3 of 3 results.

A114208 Number of permutations of [n] having exactly one fixed point and avoiding the patterns 123 and 231.

Original entry on oeis.org

1, 0, 3, 2, 6, 6, 12, 10, 21, 16, 31, 24, 44, 32, 60, 42, 77, 54, 97, 66, 120, 80, 144, 96, 171, 112, 201, 130, 232, 150, 266, 170, 303, 192, 341, 216, 382, 240, 426, 266, 471, 294, 519, 322, 570, 352, 622, 384, 677, 416, 735, 450, 794, 486, 856, 522, 921, 560
Offset: 1

Views

Author

Emeric Deutsch, Nov 17 2005

Keywords

Examples

			a(2)=0 because none of the permutations 12 and 21 has exactly one fixed point.
a(3)=3 because we have 132, 213 and 321.
a(4)=2 because we have 4132 and 4213.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 6 = 0 then n^2/6 elif n mod 6 = 1 or n mod 6 = 5 then (7*n^2-12*n+29)/24 elif n mod 6 = 2 or n mod 6 = 4 then (n^2-4)/6 else (7*n^2-12*n+45)/24 fi end: seq(a(n),n=1..70);
  • Mathematica
    npn[n_]:=Module[{c=Mod[n,6]},Which[c==0,n^2/6,c==1,(7n^2-12n+29)/24,c==2,(n^2-4)/6,c==3,(7n^2-12n+45)/24,c==4,(n^2-4)/6,c==5,(7n^2-12n+29)/24]]; Array[npn,60] (* or *) LinearRecurrence[{-1,2,3,0,-3,-2,1,1},{1,0,3,2,6,6,12,10},60] (* Harvey P. Dale, Mar 05 2012 *)

Formula

n^2/6 if n mod 6 = 0; (7*n^2-12*n+29)/24 if n mod 6 = 1 or 5; (n^2-4)/6 if n mod 6 = 2 or 4; (7*n^2-12*n+45)/24 if n mod 6 = 3.
a(n) = a(n-1)+ 2*a(n-2)+3*a(n-3)-3*a(n-5)-2*a(n-6)+a(n-7)+a(n-8). [Harvey P. Dale, Mar 05 2012]
G.f.: -x*(2*x^6+2*x^5+2*x^4+2*x^3+x^2+x+1) / ((x-1)^3*(x+1)^3*(x^2+x+1)). [Colin Barker, Aug 11 2013]

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

A307018 Total number of parts of size 3 in the partitions of n into parts of size 2 and 3.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 1, 2, 4, 2, 4, 6, 4, 6, 9, 6, 9, 12, 9, 12, 16, 12, 16, 20, 16, 20, 25, 20, 25, 30, 25, 30, 36, 30, 36, 42, 36, 42, 49, 42, 49, 56, 49, 56, 64, 56, 64, 72, 64, 72, 81, 72, 81, 90, 81, 90, 100, 90, 100, 110, 100, 110, 121, 110, 121, 132
Offset: 0

Views

Author

Andrew Ivashenko, Mar 19 2019

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,0,0,1,0,1,2,1];; for n in [9..80] do a[n]:=a[n-2]+2*a[n-3] -2*a[n-5]-a[n-6]+a[n-8]; od; a; # G. C. Greubel, Apr 03 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 80); [0,0,0] cat Coefficients(R!( x^3/((1-x^2)*(1-x^3)^2) )); // G. C. Greubel, Apr 03 2019
    
  • Mathematica
    LinearRecurrence[{0,1,2,0,-2,-1,0,1}, {0,0,0,1,0,1,2,1}, 80] (* G. C. Greubel, Apr 03 2019 *)
    Table[(6n(2+n)-5-27(-1)^n+8(4+3n)Cos[2n Pi/3]-8Sqrt[3]n Sin[2n Pi/3])/216,{n,0,66}] (* Stefano Spezia, Apr 21 2022 *)
  • PARI
    my(x='x+O('x^80)); concat([0,0,0], Vec(x^3/((1-x^2)*(1-x^3)^2))) \\ G. C. Greubel, Apr 03 2019
    
  • Sage
    (x^3/((1-x^2)*(1-x^3)^2)).series(x, 80).coefficients(x, sparse=False) # G. C. Greubel, Apr 03 2019
    

Formula

a(n+2) = A321202(n) - A114209(n+1).
a(3n+1) = A002620(n+2).
a(3n+2) = A002620(n+1).
a(3n+3) = A002620(n+2).
G.f.: x^3/((1+x)*(1+x+x^2)^2*(1-x)^3). - Alois P. Heinz, Mar 19 2019
a(n) = a(n-2) + 2*a(n-3) - 2*a(n-5) - a(n-6) + a(n-8). - G. C. Greubel, Apr 03 2019
a(n) = (6*n*(2 + n) + 8*(4 + 3*n)*cos(2*n*Pi/3) - 8*sqrt(3)*n*sin(2*n*Pi/3) - 5 - 27*(-1)^n)/216. - Stefano Spezia, Apr 21 2022
From Ridouane Oudra, Nov 24 2024: (Start)
a(n) = (7*n/2 - 7*n^2/2 - 9*floor(n/2) + (6*n+4)*floor(2*n/3) + 4*floor(n/3))/18.
a(n) = A008133(n) - A069905(n-1).
a(n) = A002620(A008611(n)). (End)

Extensions

More terms from Alois P. Heinz, Mar 19 2019
Showing 1-3 of 3 results.