|
|
A182202
|
|
Fibonacci-type sequence based on bitwise inclusive-or: a(0) = 0, a(1) = 1 and a(n) = a(n-1) + (a(n-1) or a(n-2)).
|
|
0
|
|
|
0, 1, 2, 5, 12, 25, 54, 117, 236, 489, 982, 2005, 4012, 8105, 16214, 32597, 65196, 130729, 261462, 523605, 1047212, 2095785, 4191574, 8385877, 16771756, 33548969, 67097942, 134206805, 268413612, 536849065, 1073698134, 2147439957, 4294879916, 8589847209
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
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
|
|
|
STATUS
|
approved
|
|
|
|