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-1 of 1 results.

A303427 Interleaved Lucas and Fibonacci numbers.

Original entry on oeis.org

2, 0, 1, 1, 3, 1, 4, 2, 7, 3, 11, 5, 18, 8, 29, 13, 47, 21, 76, 34, 123, 55, 199, 89, 322, 144, 521, 233, 843, 377, 1364, 610, 2207, 987, 3571, 1597, 5778, 2584, 9349, 4181, 15127, 6765, 24476, 10946, 39603, 17711, 64079, 28657, 103682, 46368, 167761
Offset: 0

Views

Author

Craig P. White, Apr 23 2018

Keywords

Examples

			a(8) = Lucas(4) = 7;
a(9) = Fibonacci(4) = 3.
		

Crossrefs

Programs

  • MATLAB
    F = zeros(1,N);
    L = ones(1,N);
    F(2) = 1;
    L(1) = 2
    for  n = 3:N
        F(n) = F(n-1) + F(n-2);
        L(n) = L(n-1) + L(n-2);
    end
    A = F;
    B = L;
    C=[B; A];
    C=C(:)';
    C
    
  • Magma
    [IsEven(n) select Lucas(n div 2) else Fibonacci((n-1) div 2): n in [0..70]]; // Vincenzo Librandi, Apr 25 2018
    
  • Maple
    a:= n-> (<<0|1>, <1|1>>^iquo(n, 2, 'r'). <<2*(1-r), 1>>)[1, 1]:
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 23 2018
  • Mathematica
    LinearRecurrence[{0, 1, 0, 1}, {2, 0, 1, 1}, 60] (* Vincenzo Librandi, Apr 25 2018 *)
    With[{nn=30},Riffle[LucasL[Range[0,nn]],Fibonacci[Range[0,nn]]]] (* Harvey P. Dale, Feb 25 2021 *)
  • PARI
    a(n) = if(n%2, fibonacci(n\2), fibonacci(n/2-1)+fibonacci(n/2+1)); \\ Altug Alkan, Apr 25 2018

Formula

a(n) = a(n-2) + a(n-4).
G.f.: -(x+1)*(x^2-2*x+2)/(x^4+x^2-1). - Alois P. Heinz, Apr 23 2018
Showing 1-1 of 1 results.