OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,3,-1,0,-2,-4).
FORMULA
From Chai Wah Wu, Oct 12 2023: (Start)
a(n) = a(n-1) + 3*a(n-2) - a(n-3) - 2*a(n-5) - 4*a(n-6) for n > 7.
G.f.: x*(8*x^6 + 2*x^3 + x + 1)/(4*x^6 + 2*x^5 + x^3 - 3*x^2 - x + 1). (End)
EXAMPLE
a(2) = 1 + (1 or 0) = 2, a(3) = 2 + (2 or 1) = 5.
MATHEMATICA
t = {0, 1}; Do[AppendTo[t, t[[-1]] + BitOr[t[[-1]], t[[-2]]]], {n, 2, 50}]; t (* T. D. Noe, Apr 18 2012 *)
PROG
(Python)
def A182202_gen(): # generator of terms
a, b = 0, 1
yield a
while True:
yield b
a, b = b, b+(a|b)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Apr 17 2012
STATUS
approved