cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A355018 Partial sums of F(1) - L(1) + F(2) - L(2) + F(3) - L(3) + ..., where F = A000045 and L = A000032.

This page as a plain text file.
%I A355018 #13 Mar 22 2024 17:43:21
%S A355018 1,0,1,-2,0,-4,-1,-8,-3,-14,-6,-24,-11,-40,-19,-66,-32,-108,-53,-176,
%T A355018 -87,-286,-142,-464,-231,-752,-375,-1218,-608,-1972,-985,-3192,-1595,
%U A355018 -5166,-2582,-8360,-4179,-13528,-6763,-21890,-10944,-35420,-17709,-57312,-28655
%N A355018 Partial sums of F(1) - L(1) + F(2) - L(2) + F(3) - L(3) + ..., where F = A000045 and L = A000032.
%C A355018 The closely related partial sums of L(1) - F(1) + L(2) - F(2) + L(3) - F(3) + .... are given by A355019.
%H A355018 G. C. Greubel, <a href="/A355018/b355018.txt">Table of n, a(n) for n = 0..1000</a>
%H A355018 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1,1,-1).
%F A355018 a(n) = 2 - 2*F((n+3)/2) if n is odd, a(n) = 2 - F((n+2)/2) if n is even, where F = A000045 (Fibonacci numbers).
%F A355018 a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) - a(n-5) for n >= 5.
%F A355018 G.f.: (1 - x - 2*x^3)/((1 - x)*(1 - x^2 - x^4)).
%F A355018 From _G. C. Greubel_, Mar 17 2024: (Start)
%F A355018 a(n) = (1/2)*Sum_{j=0..n} ( (1+(-1)^j)*Fibonacci(floor((j+3)/2)) - (1 - (-1)^j)*Lucas(floor((j+1)/2)) ).
%F A355018 a(n) = 2 - (1/2)*( (1+(-1)^n)*Fibonacci(floor((n+2)/2)) + 2*(1-(-1)^n)* Fibonacci(floor((n+3)/2)) ). (End)
%e A355018 a(0) = 1
%e A355018 a(1) = 1 - 1 = 0
%e A355018 a(2) = 1 - 1 + 1 = 1
%e A355018 a(3) = 1 - 1 + 1 - 3 = -2.
%t A355018 f[n_] := Fibonacci[n]; g[n_] := LucasL[n];
%t A355018 f1[n_] := If[OddQ[n], 2 - 2 f[(n + 3)/2], 2 - f[(n + 2)/2]]
%t A355018 f2 = Table[f1[n], {n, 0, 20}]  (* this sequence *)
%t A355018 g1[n_] := If[OddQ[n], -2 + 2 f[(n + 3)/2], -2 + f[(n + 8)/2]]
%t A355018 g2 = Table[g1[n], {n, 0, 20}]  (* A355019 *)
%t A355018 LinearRecurrence[{1,1,-1,1,-1}, {1,0,1,-2,0}, 61] (* _G. C. Greubel_, Mar 17 2024 *)
%o A355018 (Magma) F:=Fibonacci; [2 - (((n+1) mod 2)*F(Floor((n+2)/2)) + 2*(n mod 2)*F(Floor((n+3)/2))) : n in [0..60]]; // _G. C. Greubel_, Mar 17 2024
%o A355018 (SageMath) f=fibonacci; [2 - (((n+1)%2)*f(((n+2)//2)) +2*(n%2)*f((n+3)//2)) for n in range(61)] # _G. C. Greubel_, Mar 17 2024
%Y A355018 Cf. A000032, A000045, A355019, A355020, A355021.
%K A355018 sign,easy
%O A355018 0,4
%A A355018 _Clark Kimberling_, Jun 16 2022