A123968 a(n) = n^2 - 3, starting at n=1.
-2, 1, 6, 13, 22, 33, 46, 61, 78, 97, 118, 141, 166, 193, 222, 253, 286, 321, 358, 397, 438, 481, 526, 573, 622, 673, 726, 781, 838, 897, 958, 1021, 1086, 1153, 1222, 1293, 1366, 1441, 1518, 1597, 1678, 1761, 1846, 1933, 2022, 2113, 2206, 2301, 2398, 2497
Offset: 1
Examples
The quadratic factors of the characteristic polynomials of M_n for n = 1..6 are x^2 - 2*x - 2, x^2 - 4*x + 1, x^2 - 6*x + 6, x^2 - 8*x + 13, x^2 - 10*x + 22, x^2 - 12*x + 33.
Links
- Eric W. Weisstein, Chromatic Polynomial.
- Wikipedia, Chromatic polynomial.
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Programs
-
Magma
mat:=func< n | Matrix(IntegerRing(), 5, 5, [< i, j, i eq j select n else (i eq j+1 or i eq j-1) select -1 else 0 > : i, j in [1..5] ]) >; [ Coefficients(Factorization(CharacteristicPolynomial(mat(n)))[4][1])[1]:n in [1..50] ]; // Klaus Brockhaus, Nov 13 2010
-
Maple
with(combinat):seq(fibonacci(3, i)-4,i=1..55); # Zerinvary Lajos, Mar 20 2008
-
Mathematica
M[n_] := {{n, -1, 0, 0, 0}, {-1, n, -1, 0, 0}, {0, -1, n, -1, 0}, {0, 0, -1, n, -1}, {0, 0, 0, -1, n}}; p[n_, x_] = Factor[CharacteristicPolynomial[M[n], x]] Table[ -3 + n^2, {n, 1, 25}]
-
PARI
A123968(n) = n^2-3 /* or: */
-
PARI
a(n)=polcoeff(factor(charpoly(matrix(5,5,i,j,if(abs(i-j)>1,0,if(i==j,n,-1)))))[4,1], 0)
Formula
a(n) = 2*n + a(n-1) - 1. - Vincenzo Librandi, Nov 12 2010
G.f.: x*(-2+x)*(1-3*x)/(1-x)^3. - Colin Barker, Jan 29 2012
From Elmo R. Oliveira, Jan 16 2025: (Start)
E.g.f.: exp(x)*(x^2 + x - 3) + 3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. (End)
Extensions
Edited and extended by Klaus Brockhaus, Nov 13 2010
Definition simplified by M. F. Hasler, Nov 12 2010
Comments