OFFSET
1,3
COMMENTS
Generate a tree T by these rules: 0 is in T, and if x is in T, then x+1 and -2x are in T, with duplicates deleted as they occur; see A264799. Let g(0) = {0}, g(1) = {1}, g(2) = {-2,2}, g(3) = {-4,-1,3,4}, etc. The number |g(n)| of numbers in the n-th generation of T is a Fibonacci number except for g(3).
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1).
FORMULA
a(n) = F(n) for 1 <= n <= 3 and n >= 5, and a(4) = 4; where F = A000045, the Fibonacci numbers.
From Colin Barker, Nov 25 2015: (Start)
a(n) = a(n-1) - a(n-2) for n>6.
G.f.: x*(x-1)*(x+1)*(x^3+x^2+1) / (x^2+x-1).
(End)
MATHEMATICA
z = 10; t = Expand[NestList[DeleteDuplicates[Flatten[Map[{# + 1, -2*#} &, #], 1]] &, {0}, z]]; s[0] = t[[1]]; s[n_] := s[n] = Union[t[[n]], s[n - 1]];
g[n_] := Complement[s[n], s[n - 1]]; g[1] = {0};
Table[Length[g[k]], {k, 1, z}] (* A264800 *)
u = Table[g[k], {k, 1, z}]
Flatten[u] (* A264799 *)
LinearRecurrence[{1, 1}, {1, 1, 2, 4, 5, 8}, 40] (* Harvey P. Dale, Dec 09 2021 *)
PROG
(PARI) Vec(x*(x-1)*(x+1)*(x^3+x^2+1)/(x^2+x-1) + O(x^100)) \\ Colin Barker, Nov 25 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 25 2015
STATUS
approved