OFFSET
0,3
COMMENTS
Subsequence of A107686.
LINKS
Index entries for linear recurrences with constant coefficients, signature (-1,-1,2,2,2).
FORMULA
a(n) = if n<=2 then n else 2^(floor(n/3)+1) + n mod 3 - 1. - Reinhard Zumkeller, Jun 05 2005
G.f.:-x*(1+3*x+6*x^2+7*x^3+6*x^4+4*x^5+2*x^6)/((2*x^3-1)*(x^2+x+1)) [From Maksym Voznyy (voznyy(AT)mail.ru), Aug 12 2009]
MATHEMATICA
Flatten[{#-1, #, #+1}&/@(2^Range[0, 20])]//Union (* Harvey P. Dale, Oct 06 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 20 2005
EXTENSIONS
Description corrected by Henrik Lundquist, Jun 06 2005
STATUS
approved