Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #43 Dec 13 2023 08:51:59
%S 0,1,2,4,5,10,16,25,42,68,109,178,288,465,754,1220,1973,3194,5168,
%T 8361,13530,21892,35421,57314,92736,150049,242786,392836,635621,
%U 1028458,1664080,2692537,4356618,7049156,11405773,18454930,29860704,48315633,78176338,126491972,204668309,331160282,535828592
%N a(n) = a(n-1) + a(n-2) - (-1)^(a(n-1) + a(n-2)) with a(0)=0, a(1)=1.
%C 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.
%H Colin Barker, <a href="/A253198/b253198.txt">Table of n, a(n) for n = 0..1000</a>
%H W. Puszkarz, <a href="http://vixra.org/abs/1503.0113">A Note on Minimal Extensions of the Fibonacci Sequence</a>, viXra:1503.0113, 2015.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1,-1,-1).
%F a(n) = a(n-1) + a(n-2) - (-1)^(a(n-1) + a(n-2)), a(0)=0, a(1)=1.
%F 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
%F 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
%F a(n) = 2*A000045(n) - A079978(n+2). - _Nicolas Bělohoubek_, Aug 16 2021
%e For n=2, a(2) = 0 + 1 - (-1)^1 = 0 + 1 + 1 = 2.
%e For n=3, a(3) = 1 + 2 - (-1)^3 = 1 + 2 + 1 = 4.
%e For n=4, a(4) = 2 + 4 - (-1)^6 = 2 + 4 - 1 = 5.
%t 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}]
%t LinearRecurrence[{1,1,1,-1,-1},{0,1,2,4,5},50] (* _Harvey P. Dale_, Mar 17 2019 *)
%o (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
%o (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
%Y Cf. A000045, A253197, A255978, A079978.
%K nonn,easy
%O 0,3
%A _Waldemar Puszkarz_, Mar 24 2015