OFFSET
0,2
COMMENTS
Number of n-length words on {0,1,2} in which 0 appears only in runs of length 2. - Milan Janjic, Feb 14 2015
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 (terms n = 1..210 from R. H. Hardin)
D. Birmajer, J. B. Gil, and M. D. Weiner, On the Enumeration of Restricted Words over a Finite Alphabet, J. Int. Seq. 19 (2016) # 16.1.3, example 10.
Sela Fried, Proof of the conjectures stated in A239333 and A255115, 2026.
Index entries for linear recurrences with constant coefficients, signature (2,0,2).
FORMULA
a(n) = 2*a(n-1) + 2*a(n-3).
G.f.: (1 + x^2) / (1 - 2*x - 2*x^3). - Colin Barker, Feb 18 2018
EXAMPLE
Some solutions for n=5:
..0....2....2....2....0....0....0....0....2....2....2....2....2....0....2....2
..2....0....2....0....2....0....2....0....0....0....0....2....2....2....0....3
..2....2....2....3....2....2....3....0....2....2....3....0....0....0....3....2
..0....0....0....2....2....2....2....0....2....2....3....0....2....0....2....3
..2....2....2....0....2....0....0....0....3....0....2....2....3....2....3....2
MAPLE
a:= n-> (<<0|1|0>, <0|0|1>, <2|0|2>>^n. <<1, 2, 5>>)[1, 1]:
seq(a(n), n=0..31); # Alois P. Heinz, Feb 28 2026
MATHEMATICA
RecurrenceTable[{a[0] == 1, a[1] == 2, a[2]== 5, a[n] == 2 a[n - 1] + 2 a[n - 3]}, a[n], {n, 0, 29}] (* Milan Janjic, Feb 14 2015 *)
PROG
(PARI) Vec(-(x^2+1)/(2*x^3+2*x-1) + O(x^100)) \\ Colin Barker, Feb 15 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Mar 16 2014
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Feb 27 2026
Content from A255115 moved into this page by Alois P. Heinz, Feb 28 2026
STATUS
approved
