|
|
A253198
|
|
a(n) = a(n-1) + a(n-2) - (-1)^(a(n-1) + a(n-2)) with a(0)=0, a(1)=1.
|
|
3
|
|
|
0, 1, 2, 4, 5, 10, 16, 25, 42, 68, 109, 178, 288, 465, 754, 1220, 1973, 3194, 5168, 8361, 13530, 21892, 35421, 57314, 92736, 150049, 242786, 392836, 635621, 1028458, 1664080, 2692537, 4356618, 7049156, 11405773, 18454930, 29860704, 48315633, 78176338, 126491972, 204668309, 331160282, 535828592
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
This is a minimally modified Fibonacci sequence (A000045) in that it preserves characteristic properties of the original sequence: a(n) is a function of the sum of the preceding two terms, the ratio of two consecutive terms tends to the Golden Mean, and the initial two terms are the same as in the Fibonacci sequence. See A253197 and A255978 for other members of this family.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(n-1) + a(n-2) - (-1)^(a(n-1) + a(n-2)), a(0)=0, a(1)=1.
a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4) - a(n-5) for n>4. - Colin Barker, Mar 28 2015
G.f.: -x*(2*x^3-x^2-x-1) / ((x-1)*(x^2+x-1)*(x^2+x+1)). - Colin Barker, Mar 28 2015
|
|
EXAMPLE
|
For n=2, a(2) = 0 + 1 - (-1)^1 = 0 + 1 + 1 = 2.
For n=3, a(3) = 1 + 2 - (-1)^3 = 1 + 2 + 1 = 4.
For n=4, a(4) = 2 + 4 - (-1)^6 = 2 + 4 - 1 = 5.
|
|
MATHEMATICA
|
RecurrenceTable[{a[n]==a[n-1]+a[n-2] -(-1)^(a[n-1]+a[n-2]), a[0]==0, a[1]==1}, a, {n, 0, 50}]
LinearRecurrence[{1, 1, 1, -1, -1}, {0, 1, 2, 4, 5}, 50] (* Harvey P. Dale, Mar 17 2019 *)
|
|
PROG
|
(Magma) [n le 2 select (n-1) else Self(n-1) + Self(n-2) - (-1)^(Self(n-1) + Self(n-2)): n in [1..50] ]; // Vincenzo Librandi, Mar 28 2015
(PARI) concat(0, Vec(-x*(2*x^3-x^2-x-1)/((x-1)*(x^2+x-1)*(x^2+x+1)) + O(x^100))) \\ Colin Barker, Mar 28 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|