OFFSET
1,2
COMMENTS
Equivalently, the number of 0..m words of length n with cyclically adjacent letters unequal with the exception that 0's may be adjacent.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1275
FORMULA
Row g.f.: ((m+1)-(m^2-2)*x-(2*m-1)*x^2)/(1-(m-1)*x-(m+1)*x^2-x^3).
EXAMPLE
Table starts:
====================================================
m\n| 1 2 3 4 5 6 7 8
---|------------------------------------------------
1 | 1 3 4 7 11 18 29 47 ...
2 | 1 7 13 35 81 199 477 1155 ...
3 | 1 13 34 121 391 1300 4285 14161 ...
4 | 1 21 73 325 1361 5781 24473 103685 ...
5 | 1 31 136 731 3771 19606 101781 528531 ...
6 | 1 43 229 1447 8881 54763 337429 2079367 ...
7 | 1 57 358 2605 18551 132504 946037 6754805 ...
8 | 1 73 529 4361 35361 287305 2333745 18957321 ...
...
MATHEMATICA
max = 10; row[m_] := ((m+1) - (m^2 - 2)*x - (2*m - 1)*x^2)/(1 - (m-1)*x - (m+1)*x^2 - x^3) + O[x]^(max+1) // CoefficientList[#, x]& // Rest;
T = Table[row[m], {m, 1, max}];
Table[T[[m-n+1, n]], {m, 1, max}, {n, m, 1, -1}] // Flatten (* Jean-François Alcover, Jun 06 2017 *)
PROG
(PARI)
RowGf(m, x)=((m+1)-(m^2-2)*x-(2*m-1)*x^2)/(1-(m-1)*x-(m+1)*x^2-x^3);
for (m=1, 8, for(n=1, 8, print1(Vec(RowGf(m, x)+O(x^(n+1)))[n+1], " ")); print);
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, May 23 2017
STATUS
approved