OFFSET
1,5
COMMENTS
REFERENCES
A. Engel, Wahrscheinlichkeit und Statistik, Band 2, Klett, 1978, pages 25-26.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,1,0,-1).
FORMULA
a(n) = a(n-1)+a(n-2)+a(n-3)-a(n-5) for n>7.
a(n) = 2*a(n-1)-a(n-4)-a(n-5)+a(n-6) for n>8.
G.f.: x^4*(1+x)*(1+x^2)/(1-x-x^2-x^3+x^5).
a(n) = A164388(n-4) for n > 3. - Georg Fischer, Oct 14 2018
EXAMPLE
For n=6 the a(6)=4 solutions are (0,0,0,0,1,1),(1,0,0,0,1,1),(0,1,0,0,1,1),(1,1,0,0,1,1).
MAPLE
a(1):=0: a(2):=0: a(3):=0: a(4):=1: a(5):=2:
a(6):=4: a(7):=8: pot:=2^3: pa:=0:
for n from 4 to 7 do
pot:=2*pot:
pa:=pa+a(n)/pot:
end do:
for n from 8 to 100 do
pot:=2*pot:
a(n):=a(n-1)+a(n-2)+a(n-3)-a(n-5):
pa:=pa+a(n)/pot:
end do:
printf("%10.5f", pa):
seq(a(n), n=1..100);
MATHEMATICA
LinearRecurrence[{1, 1, 1, 0, -1}, {0, 0, 0, 1, 2, 4, 8}, 40] (* Harvey P. Dale, Jul 11 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Weisenhorn, Nov 12 2011
STATUS
approved