OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..3320
H. Harborth, Endliche 0-1-Folgen mit gleichen Teilblöcken, Journal für Mathematik, 271 (1974) 139-154.
FORMULA
a(n) = 2*a(n-1) + (-1)^n * a(ceiling(n/2)) for n >= 3.
a(n) = a(n-1) + 2*a(n-2) if n >= 4 even. a(n) = a(n-1) + 2*a(n-2) + 2*a((n-1)/2) if n>=7 == 3 (mod 4). - Michael Somos, Jan 23 2014
EXAMPLE
G.f. = 2*x^2 + 2*x^3 + 6*x^4 + 10*x^5 + 22*x^6 + 38*x^7 + 82*x^8 + ...
a(4) = 6 because we have: {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 1}, {1, 1, 0, 1}. These are precisely the binary words of length 4 with autocorrelation polynomial equal to 1 + z^3. - Geoffrey Critzer, Apr 13 2022
MAPLE
f:= proc(n) option remember;
2*procname(n-1)+(-1)^n*procname(ceil(n/2))
end proc:
f(1):= 0: f(2):= 2:
map(f, [$1..100]); # Robert Israel, Jul 15 2018
PROG
(PARI) a(n) = if (n==1, 0, if (n==2, 2, 2*a(n-1) + (-1)^n*a(ceil(n/2)))) \\ Michel Marcus, May 25 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved