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.

Showing 1-3 of 3 results.

A355020 a(n) = (-1)^n * A000045(n) + 1.

Original entry on oeis.org

1, 0, 2, -1, 4, -4, 9, -12, 22, -33, 56, -88, 145, -232, 378, -609, 988, -1596, 2585, -4180, 6766, -10945, 17712, -28656, 46369, -75024, 121394, -196417, 317812, -514228, 832041, -1346268, 2178310, -3524577, 5702888, -9227464, 14930353, -24157816, 39088170
Offset: 0

Views

Author

Clark Kimberling, Jun 21 2022

Keywords

Comments

There are the partial sums of F(1) - F(2) + F(3) - F(4) + F(5) - ... .
Closely related (Lucas, A000032) partial sums of L(1) - L(2) + L(3) - L(4) + L(5) - ... are given by A355021.
Apart from signs, same as A008346 and A119282.

Examples

			a(0) = 1;
a(1) = 1 - 1 = 0;
a(2) = 1 - 1 + 2 = 2;
a(3) = 1 - 1 + 2 - 3 = -1.
		

Crossrefs

Programs

  • Magma
    [1 - Fibonacci(-n): n in [0..50]]; // G. C. Greubel, Mar 17 2024
    
  • Mathematica
    f[n_] := Fibonacci[n]; g[n_] := LucasL[n];
    Table[(-1)^n f[n] + 1, {n, 0, 40}]   (* this sequence *)
    Table[(-1)^n g[n] - 1, {n, 0, 40}]   (* A355021 *)
    1 - Fibonacci[-Range[0, 50]] (* G. C. Greubel, Mar 17 2024 *)
  • PARI
    a(n) = (-1)^n*fibonacci(n) + 1; \\ Michel Marcus, Jun 24 2022
    
  • SageMath
    [1 - fibonacci(-n) for n in range(51)] # G. C. Greubel, Mar 17 2024

Formula

a(n) = 2*a(n-2) - a(n-3) for n > 2.
G.f.: 1/(1 - 2*x^2 + x^3).

A355021 a(n) = (-1)^n * A000032(n) - 1.

Original entry on oeis.org

1, -2, 2, -5, 6, -12, 17, -30, 46, -77, 122, -200, 321, -522, 842, -1365, 2206, -3572, 5777, -9350, 15126, -24477, 39602, -64080, 103681, -167762, 271442, -439205, 710646, -1149852, 1860497, -3010350, 4870846, -7881197, 12752042, -20633240, 33385281
Offset: 0

Views

Author

Clark Kimberling, Jun 21 2022

Keywords

Comments

There are the partial sums of L(1) - L(2) + L(3) - L(4) + L(5) - ... .
Closely related (Fibonacci, A000045) partial sums of F(1) - F(2) + F(3) - F(4) + F(5) - ... are given by A355020.
Apart from signs, same as A098600 and A181716.

Examples

			a(0) = 1;
a(1) = 1 - 3 = -2;
a(2) = 1 - 3 + 4 = 2;
a(3) = 1 - 3 + 4 - 7 = -5.
		

Crossrefs

Programs

  • Magma
    [Lucas(-n) -1: n in [0..50]]; // G. C. Greubel, Mar 17 2024
    
  • Mathematica
    f[n_] := Fibonacci[n]; g[n_] := LucasL[n];
    f1 = Table[(-1)^n f[n] + 1, {n, 0, 40}]   (* A355020 *)
    g1 = Table[(-1)^n g[n] - 1, {n, 0, 40}]   (* this sequence *)
    LucasL[-Range[0, 50]] - 1 (* G. C. Greubel, Mar 17 2024 *)
    LinearRecurrence[{0,2,-1},{1,-2,2},40] (* Harvey P. Dale, Sep 06 2024 *)
  • SageMath
    [lucas_number2(-n,1,-1) -1 for n in range(51)] # G. C. Greubel, Mar 17 2024

Formula

a(n) = 2*a(n-2) - a(n-3) for n >= 3. [Corrected by Georg Fischer, Sep 30 2022]
G.f.: (1 - 2*x)/(1 - 2*x^2 + x^3).

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

Original entry on oeis.org

1, 0, 1, -2, 0, -4, -1, -8, -3, -14, -6, -24, -11, -40, -19, -66, -32, -108, -53, -176, -87, -286, -142, -464, -231, -752, -375, -1218, -608, -1972, -985, -3192, -1595, -5166, -2582, -8360, -4179, -13528, -6763, -21890, -10944, -35420, -17709, -57312, -28655
Offset: 0

Views

Author

Clark Kimberling, Jun 16 2022

Keywords

Comments

The closely related partial sums of L(1) - F(1) + L(2) - F(2) + L(3) - F(3) + .... are given by A355019.

Examples

			a(0) = 1
a(1) = 1 - 1 = 0
a(2) = 1 - 1 + 1 = 1
a(3) = 1 - 1 + 1 - 3 = -2.
		

Crossrefs

Programs

  • 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
    
  • Mathematica
    f[n_] := Fibonacci[n]; g[n_] := LucasL[n];
    f1[n_] := If[OddQ[n], 2 - 2 f[(n + 3)/2], 2 - f[(n + 2)/2]]
    f2 = Table[f1[n], {n, 0, 20}]  (* this sequence *)
    g1[n_] := If[OddQ[n], -2 + 2 f[(n + 3)/2], -2 + f[(n + 8)/2]]
    g2 = Table[g1[n], {n, 0, 20}]  (* A355019 *)
    LinearRecurrence[{1,1,-1,1,-1}, {1,0,1,-2,0}, 61] (* G. C. Greubel, Mar 17 2024 *)
  • 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

Formula

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).
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) - a(n-5) for n >= 5.
G.f.: (1 - x - 2*x^3)/((1 - x)*(1 - x^2 - x^4)).
From G. C. Greubel, Mar 17 2024: (Start)
a(n) = (1/2)*Sum_{j=0..n} ( (1+(-1)^j)*Fibonacci(floor((j+3)/2)) - (1 - (-1)^j)*Lucas(floor((j+1)/2)) ).
a(n) = 2 - (1/2)*( (1+(-1)^n)*Fibonacci(floor((n+2)/2)) + 2*(1-(-1)^n)* Fibonacci(floor((n+3)/2)) ). (End)
Showing 1-3 of 3 results.