OFFSET
0,2
COMMENTS
F(f0,f1,f2) is the sequence a(n) defined by a(0)=f0, a(1)=f1, a(2)=f2, and for n >= 3, a(n) = floor(1/2 + (a(n-1)/a(n-2))*(a(n-1)+a(n-3))-a(n-2)) unless a(n-2)=0 in which case a(n) = - a(n-4).
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
D. W. Boyd, Some integer sequences related to the Pisot sequences, Acta Arithmetica, 34 (1979), 295-305. See page 296.
FORMULA
Conjectures from Colin Barker, Jul 26 2016: (Start)
a(n) = a(n-1)+a(n-3)+a(n-5)-a(n-6) for n>5.
G.f.: x*(5+6*x+8*x^2+6*x^3+5*x^4) / (1-x-x^3-x^5+x^6).
(End)
Note the warning in A010925 from Pab Ter (pabrlos(AT)yahoo.com), May 23 2004: [A010925] and other examples show that it is essential to reject conjectured generating functions for Pisot sequences until a proof or reference is provided. - N. J. A. Sloane, Jul 26 2016
MAPLE
f:=proc(n) option remember; global f0, f1, f2;
if n = 0 then f0
elif n=1 then f1
elif n=2 then f2
elif f(n-2)=0 then -f(n-4)
else floor(1/2 + (f(n-1)/f(n-2))*(f(n-1)+f(n-3))-f(n-2)); fi;
end;
f0:=0; f1:=5; f2:=11; [seq(f(n), n=0..40)];
PROG
(Magma) f:=[0, 5, 11]; [n le 3 select f[n] else Floor(1/2+(Self(n-1)/Self(n-2))*(Self(n-1)+Self(n-3))-Self(n-2)): n in [1..50]]; // Bruno Berselli, Jul 26 2016
(PARI) boyd(nmax, f1, f2, f3) = {
f=vector(nmax); f[1]=f1; f[2]=f2; f[3]=f3;
for(n=4, nmax, f[n] = floor(1/2 + (f[n-1]/f[n-2])*(f[n-1]+f[n-3])-f[n-2]));
f
}
boyd(50, 0, 5, 11) \\ Colin Barker, Jul 26 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 26 2016
STATUS
approved