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

A353655 Number of terms in the Fibonacci-Lucas representation of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 1, 2, 3, 2, 2, 1, 2, 3, 2, 2, 3, 3, 2, 1, 2, 3, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 1, 2, 3, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 4, 3, 4, 2, 3, 3, 1, 2, 3, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 4, 3, 4, 2, 3, 3, 3, 4, 3, 4, 5, 3, 4, 5, 2, 3, 3
Offset: 1

Views

Author

Clark Kimberling, May 02 2022

Keywords

Comments

The Fibonacci-Lucas representation of n, denoted by FL(n), is defined for n>=1 as the sum t(1) + t(2) + ... + t(k), where t(1) is the greatest Fibonacci number (A000045(n), with n>=2) that is <= n, and t(2) is the greatest Lucas number (A000032(n), with n >= 1) that is <= n - t(1), and so on; that is, the greedy algorithm is applied to find successive greatest Fibonacci and Lucas numbers, in alternating order, with sum n. (See Example.)

Examples

			  n      FL(n)
  1   =  1
  2   =  2
  3   =  3
  4   =  3 + 1
  5   =  5
  6   =  5 + 1
  33  =  21 + 11 + 1
  47  =  34 + 11 + 2
  83  =  55 + 18 + 8 + 1 + 1
		

Crossrefs

Programs

  • Mathematica
    z = 120; fib = Map[Fibonacci, Range[2, 51]];
    luc = Map[LucasL, Range[1, 50]];
    t = Map[(n = #; fl = {}; f = 0; l = 0;
         While[IntegerQ[l], n = n - f - l;
          f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n &] - 1]];
          l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n - f &] - 1]];
          AppendTo[fl, {f, l}]];
         {Total[#], #} &[Select[Flatten[fl], IntegerQ]]) &, Range[z]];
    u = Take[Map[Last, t], z];
    u1 = Map[Length, u]  (* A353655 *)
    t = Map[(n = #; lf = {}; f = 0; l = 0;
         While[IntegerQ[f], n = n - l - f;
          l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n &] - 1]];
          f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n - l &] - 1]];
          AppendTo[lf, {l, f}]];
         {Total[#], #} &[Select[Flatten[lf], IntegerQ]]) &, Range[z]];
    v = Take[Map[Last, t], z];
    v1 = Map[Length, v]   (* A353656 *)
    u1 - v1  (* A353657 *)
    (* Peter J. C. Moses *)

A353656 Number of terms in the Lucas-Fibonacci representation of n.

Original entry on oeis.org

1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 1, 2, 2, 2, 3, 2, 3, 4, 2, 3, 4, 1, 2, 2, 2, 3, 2, 3, 4, 2, 3, 4, 3, 3, 2, 3, 4, 3, 3, 1, 2, 2, 2, 3, 2, 3, 4, 2, 3, 4, 3, 3, 2, 3, 4, 3, 3, 4, 4, 3, 2, 3, 4, 3, 3, 4, 4, 3, 1, 2, 2, 2, 3, 2, 3, 4, 2, 3, 4
Offset: 1

Views

Author

Clark Kimberling, May 04 2022

Keywords

Comments

The Lucas-Fibonacci representation of n, denoted by LF(n), is defined for n>=1 as the sum t(1) + t(2) + ... + t(k), where t(1) is the greatest Lucas number (A000032(n), with n >= 1) that is <= n, and t(2) is the greatest Fibonacci number (A000045(n), with n >= 2) that is <= n - t(1), and so on; that is, the greedy algorithm is applied to find successive greatest Lucas and Fibonacci numbers, in alternating order, with sum n. (See Example.)

Examples

			   n     LF(n)
   1  =  1
   2  =  1 + 1
   3  =  3
   4  =  4
   5  =  4 + 1
   6  =  4 + 2
  17  =  11 + 5 + 1
  66  =  47 + 13 + 4 + 2
		

Crossrefs

Programs

  • Mathematica
    z = 120; fib = Map[Fibonacci, Range[2, 51]];
    luc = Map[LucasL, Range[1, 50]];
    t = Map[(n = #; fl = {}; f = 0; l = 0;
         While[IntegerQ[l], n = n - f - l;
          f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n &] - 1]];
          l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n - f &] - 1]];
          AppendTo[fl, {f, l}]];
         {Total[#], #} &[Select[Flatten[fl], IntegerQ]]) &, Range[z]];
    u = Take[Map[Last, t], z];
    u1 = Map[Length, u]  (* A353655 *)
    t = Map[(n = #; lf = {}; f = 0; l = 0;
         While[IntegerQ[f], n = n - l - f;
          l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n &] - 1]];
          f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n - l &] - 1]];
          AppendTo[lf, {l, f}]];
         {Total[#], #} &[Select[Flatten[lf], IntegerQ]]) &, Range[z]];
    v = Take[Map[Last, t], z];
    v1 = Map[Length, v]   (* A353656 *)
    u1 - v1  (* A353657 *)
    (* Peter J. C. Moses, May 04 2022 *)
Showing 1-2 of 2 results.