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.

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

This page as a plain text file.
%I A353655 #11 Dec 26 2024 21:43:48
%S A353655 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,
%T A353655 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,
%U A353655 3,4,3,4,2,3,3,3,4,3,4,5,3,4,5,2,3,3
%N A353655 Number of terms in the Fibonacci-Lucas representation of n.
%C A353655 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.)
%e A353655   n      FL(n)
%e A353655   1   =  1
%e A353655   2   =  2
%e A353655   3   =  3
%e A353655   4   =  3 + 1
%e A353655   5   =  5
%e A353655   6   =  5 + 1
%e A353655   33  =  21 + 11 + 1
%e A353655   47  =  34 + 11 + 2
%e A353655   83  =  55 + 18 + 8 + 1 + 1
%t A353655 z = 120; fib = Map[Fibonacci, Range[2, 51]];
%t A353655 luc = Map[LucasL, Range[1, 50]];
%t A353655 t = Map[(n = #; fl = {}; f = 0; l = 0;
%t A353655      While[IntegerQ[l], n = n - f - l;
%t A353655       f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n &] - 1]];
%t A353655       l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n - f &] - 1]];
%t A353655       AppendTo[fl, {f, l}]];
%t A353655      {Total[#], #} &[Select[Flatten[fl], IntegerQ]]) &, Range[z]];
%t A353655 u = Take[Map[Last, t], z];
%t A353655 u1 = Map[Length, u]  (* A353655 *)
%t A353655 t = Map[(n = #; lf = {}; f = 0; l = 0;
%t A353655      While[IntegerQ[f], n = n - l - f;
%t A353655       l = luc[[NestWhile[# + 1 &, 1, luc[[#]] <= n &] - 1]];
%t A353655       f = fib[[NestWhile[# + 1 &, 1, fib[[#]] <= n - l &] - 1]];
%t A353655       AppendTo[lf, {l, f}]];
%t A353655      {Total[#], #} &[Select[Flatten[lf], IntegerQ]]) &, Range[z]];
%t A353655 v = Take[Map[Last, t], z];
%t A353655 v1 = Map[Length, v]   (* A353656 *)
%t A353655 u1 - v1  (* A353657 *)
%t A353655 (* _Peter J. C. Moses_ *)
%Y A353655 Cf. A000032, A000045, A007895, A116543, A353656, A353657.
%K A353655 nonn
%O A353655 1,4
%A A353655 _Clark Kimberling_, May 02 2022