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.

A141221 Number of ways for each of 2n (labeled) people in a circle to look at either a neighbor or the diametrally opposite person, such that no eye contact occurs.

Original entry on oeis.org

0, 30, 156, 826, 4406, 23562, 126104, 675074, 3614142, 19349430, 103593804, 554625898, 2969386478, 15897666066, 85113810056, 455687062274, 2439682811478, 13061709929934, 69930511268508, 374397872321626
Offset: 1

Views

Author

Max Alekseyev, Jun 14 2008

Keywords

Examples

			a(1)=0 because two people always make eye contact when they look at each other.
a(2)=30 because 4 people can look at each other in 30 distinct ways without making eye contact.
		

Crossrefs

Programs

  • Magma
    I:=[30, 156, 826, 4406]; [0] cat [n le 4 select I[n] else 8*Self(n-1) -16*Self(n-2) +10*Self(n-3) -Self(n-4): n in [1..30]]; // G. C. Greubel, Mar 31 2021
    
  • Mathematica
    Join[{0}, LinearRecurrence[{8, -16, 10, -1}, {30, 156, 826, 4406}, 20]] (* Jean-François Alcover, Dec 14 2018 *)
  • Sage
    def A141221_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( 2*x^2*(15 -42*x +29*x^2 -3*x^3)/((1-x)*(1-7*x+9*x^2-x^3)) ).list()
    a=A141221_list(30)
    print(a[1:]) # G. C. Greubel, Mar 31 2021

Formula

a(n) = 8*a(n-1) - 16*a(n-2) + 10*a(n-3) - a(n-4), for n > 1.
O.g.f.: 2*x^2*(15 -42*x +29*x^2 -3*x^3)/((1-x)*(1-7*x+9*x^2-x^3)). - R. J. Mathar, Jun 16 2008
a(n) = -7*[n=1] + (A141385(n) - 1). - G. C. Greubel, Mar 31 2021

A141385 a(n) = 7*a(n-1) - 9*a(n-2) + a(n-3) with a(0)=3, a(1)=7, a(2)=31.

Original entry on oeis.org

3, 7, 31, 157, 827, 4407, 23563, 126105, 675075, 3614143, 19349431, 103593805, 554625899, 2969386479, 15897666067, 85113810057, 455687062275, 2439682811479, 13061709929935, 69930511268509, 374397872321627
Offset: 0

Views

Author

Gerard P. Michon, Jul 02 2008, Jul 23 2008

Keywords

Comments

The old definition given for this sequence was "A sequence obeying a third-order linear recurrence".
Ruling out finitely many exceptional terms, this sequence differs by a constant from several related enumerations with a slightly more complicated structure (fourth-order linear recurrence):
For n>0, A141221(n) = a(n) - 1. For n>2, A141384(n) = a(n) + 1.

Examples

			a(0) = 3 = A^0 + B^0 + C^0, a(1) = 7 = A + B + C.
		

Crossrefs

Programs

  • Magma
    I:=[3,7,31]; [n le 3 select I[n] else 7*Self(n-1)-9*Self(n-2)+Self(n-3): n in [1..30]]; // Vincenzo Librandi, Oct 21 2012
    
  • Maple
    m:=30; S:=series( (3-14*x+9*x^2)/(1-7*x+9*x^2-x^3), x, m+1):
    seq(coeff(S, x, j), j=0..m); # G. C. Greubel, Mar 30 2021
  • Mathematica
    LinearRecurrence[{7,-9,1},{3,7,31},40] (* Harvey P. Dale, May 25 2011 *)
    CoefficientList[Series[(3 -14x +9x^2)/(1 -7x +9x^2 -x^3), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 21 2012 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 1,-9,7]^n*[3;7;31])[1,1] \\ Charles R Greathouse IV, Feb 10 2017
    
  • Sage
    def A141385_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( (3-14*x+9*x^2)/(1-7*x+9*x^2-x^3) ).list()
    A141385_list(40) # G. C. Greubel, Mar 30 2021

Formula

G.f.: (3 - 14*x + 9*x^2)/(1 - 7*x + 9*x^2 - x^3).
a(n+3) = 7*a(n+2) - 9*a(n+1) + a(n).
a(n) = A^n + B^n + C^n, where, putting u = atan(sqrt(5319)/73), we have:
A = 5.3538557854308282... = (7 + 2*sqrt(22)*cos(u/3))/3,
B = 1.5235479602692093... = (7 - sqrt(22)*cos(u/3) + sqrt(66)*sin(u/3))/3,
C = 0.1225962542999624... = (7 - sqrt(22)*cos(u/3) - sqrt(66)*sin(u/3))/3.

Extensions

New definition by Bruno Berselli, Oct 22 2012
Showing 1-2 of 2 results.