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.

A302126 Interleaved Fibonacci and Lucas numbers.

Original entry on oeis.org

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

Views

Author

Patrick D McLean, Apr 01 2018

Keywords

Examples

			a(10) = Fibonacci(5) = 5;
a(11) = Lucas(5) = 11.
		

Crossrefs

Interleaves A000045 and A000032.

Programs

  • GAP
    Flat(List([1..25],n->[Fibonacci(n),Lucas(1,-1,n)[2]])); # Muniru A Asiru, Apr 02 2018
  • Maple
    a:= n-> (<<0|1>, <1|1>>^iquo(n, 2, 'r'). <<2*r, 1>>)[1, 1]:
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 23 2018
  • Mathematica
    Table[{Fibonacci[n], LucasL[n]}, {n, 0, 25}] // Flatten
    LinearRecurrence[{0, 1, 0, 1}, {0, 2, 1, 1}, 52]
    Flatten@ Array[{LucasL@#, Fibonacci@#} &, 26, 0] (* or *)
    CoefficientList[Series[(x^3 - x^2 - 2x)/(x^4 + x^2 - 1), {x, 0, 51}], x] (* Robert G. Wilson v, Apr 02 2018 *)
  • PARI
    concat(0, Vec(x*(2 - x)*(1 + x) / (1 - x^2 - x^4) + O(x^60))) \\ Colin Barker, Apr 02 2018
    

Formula

a(0) = 0; a(1) = 2; a(2) = 1; a(3) = 1; a(n) = a(n-2) + a(n-4), n >= 4.
G.f.: x*(2 - x)*(1 + x) / (1 - x^2 - x^4). - Colin Barker, Apr 02 2018
a(0) = 0; a(1) = 2; a(2n) = (a(2n-1) + a(2n-2))/2; a(2n+1) = a(2n) + 2*a(2n-2), n >= 1. - Daniel Forgues, Jul 29 2018

Extensions

More terms from Colin Barker, Apr 02 2018