OFFSET
0,2
COMMENTS
8 divides a(n) for all n.
lim n -> infinity a(n)/8^n ~ 0.73661041899617 is the probability that a random, infinite string over an 8-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_8 with loops that do not begin with a palindromic sequence.
LINKS
Peter Kagey, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = 8^n - A249641(n) for n > 0.
EXAMPLE
For n = 3, the first 10 of the a(3) = 392 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 016, 017, 021, 022, 023.
MATHEMATICA
a252701[n_] := Block[{f}, f[0] = f[1] = 0;
f[x_] := 8*f[x - 1] + 8^Ceiling[(x)/2] - f[Ceiling[(x)/2]];
Prepend[Rest@Table[8^i - f[i], {i, 0, n}], 0]]; a252701[21] (* Michael De Vlieger, Dec 26 2014 *)
PROG
(Ruby) seq = [1, 0]; (2..N).each { |i| seq << 8 * seq[i-1] + 8**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 8**i - a }
CROSSREFS
KEYWORD
easy,nonn,walk
AUTHOR
Peter Kagey, Dec 20 2014
STATUS
approved