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.

Previous Showing 11-16 of 16 results.

A353658 Rectangular array by antidiagonals: row k lists the numbers whose Fibonacci-Lucas representation has k terms.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 5, 9, 10, 49, 8, 11, 15, 51, 80, 13, 12, 18, 70, 83, 549, 21, 14, 19, 72, 114, 551, 889, 34, 16, 23, 77, 117, 570, 892, 6094, 55, 17, 26, 79, 125, 572, 923, 6096, 9861, 89, 20, 27, 82, 128, 782, 926, 6115, 9864, 67589
Offset: 1

Views

Author

Clark Kimberling, May 04 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. Every positive integer occurs exactly once in the array.

Examples

			Northwest corner:
     1     2     3     5     8    13    21    34
     4     6     9    11    12    14    16    17
     7    10    15    18    19    23    26    27
    49    51    70    72    77    79    82    88
    80    83   114   117   125   128   133   143
   549   551   570   572   782   784   803   805
   889   892   923   926  1266  1269  1300  1303
  6094  6096  6115  6117  6327  6329  6348  6350
		

Crossrefs

Programs

  • Mathematica
    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[8000]];
    Length[t];
    u = Table[Length[t[[n]][[2]]], {n, 1, Length[t]}];
    Take[u, 150]
    TableForm[Table[Flatten[Position[u, k]], {k, 1, 8}]]
    w[k_, n_] := Flatten[Position[u, k]][[n]]
    Table[w[n - k + 1, k], {n, 8}, {k, n, 1, -1}] // Flatten
    (* Peter J. C. Moses, May 04 2022 *)

A353659 Rectangular array read by downwards antidiagonals: row k lists the numbers whose Lucas-Fibonacci representation has k terms.

Original entry on oeis.org

1, 3, 2, 4, 5, 15, 7, 6, 17, 25, 11, 8, 22, 28, 172, 18, 9, 24, 36, 174, 279, 29, 10, 27, 39, 193, 282, 1913, 47, 12, 33, 44, 195, 313, 1915, 3096, 76, 13, 35, 54, 248, 316, 1934, 3099, 21221, 123, 14, 38, 57, 250, 402, 1936, 3130, 21223, 34337
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. Every positive integer occurs exactly once in this array.

Examples

			Northwest corner:
     1     3     4     7    11    18    29    47    76   123
     2     5     6     8     9    10    12    13    14    16
    15    17    22    24    27    33    35    38    40    41
    25    28    36    39    44    54    57    62    65    66
   172   174   193   195   248   250   269   271   276   278
   279   282   313   316   402   405   436   439   447   450
  1913  1915  1934  1936  2146  2148  2167  2169  2756  2758
  3096  3099  3130  3133  3473  3476  3507  3510  4460  4463
		

Crossrefs

Programs

  • Mathematica
    fib = Map[Fibonacci, Range[2, 51]];
    luc = Map[LucasL, Range[1, 50]];
    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[50000]];
    Length[t];
    u = Table[Length[t[[n]][[2]]], {n, 1, Length[t]}];
    Take[u, 150]
    TableForm[Table[Flatten[Position[u, k]], {k, 1, 11}]];
    w[k_, n_] := Flatten[Position[u, k]][[n]]
    Table[w[n - k + 1, k], {n, 11}, {k, n, 1, -1}] // Flatten
    (* Peter J. C. Moses, May 04 2022 *)

A336007 Numbers whose mixed Zeckendorf-Lucas representation is not a Zeckendorf or Lucas representation. See Comments.

Original entry on oeis.org

17, 25, 28, 38, 41, 45, 46, 52, 53, 59, 62, 66, 67, 72, 73, 74, 75, 81, 82, 84, 85, 86, 93, 96, 100, 101, 106, 107, 108, 109, 114, 117, 118, 119, 120, 121, 122, 128, 129, 131, 132, 133, 136, 137, 138, 139, 140, 148, 151, 155, 156, 161, 162, 163, 164, 169
Offset: 1

Views

Author

Clark Kimberling, Jul 06 2020

Keywords

Comments

Suppose that B1 and B2 are increasing sequences of positive integers, and let B be the increasing sequence of numbers in the union of B1 and B2. Every positive integer n has a unique representation given by the greedy algorithm with B1 as base, and likewise for B2 and B.

Examples

			17 = 13 + 4;
25 = 21 + 4;
28 = 21 + 7.
		

Crossrefs

Programs

  • Mathematica
    fibonacciQ[n_] := IntegerQ[Sqrt[5 n^2 + 4]] || IntegerQ[Sqrt[5 n^2 - 4]];
    Attributes[fibonacciQ] = {Listable};
    lucasQ[n_] := IntegerQ[Sqrt[5 n^2 + 20]] || IntegerQ[Sqrt[5 n^2 - 20]];
    Attributes[lucasQ] = {Listable};
    s = Reverse[Union[Flatten[Table[{Fibonacci[n + 1], LucasL[n - 1]}, {n, 1, 22}]]]];
    u = Map[#[[1]] &, Select[Map[{#[[1]], {Apply[And, fibonacciQ[#[[2]]]],
           Apply[And, lucasQ[#[[2]]]]}} &, Map[{#, DeleteCases[
            s Reap[FoldList[(Sow[Quotient[#1, #2]]; Mod[#1, #2]) &, #,
                s]][[2, 1]], 0]} &,
         Range[500]]], #[[2]] == {False, False} &]]
    (* Peter J. C. Moses, Jun 14 2020 *)

A342089 Numbers that have two representations as the sum of distinct non-consecutive Lucas numbers (A000032).

Original entry on oeis.org

5, 12, 16, 23, 30, 34, 41, 45, 52, 59, 63, 70, 77, 81, 88, 92, 99, 106, 110, 117, 121, 128, 135, 139, 146, 153, 157, 164, 168, 175, 182, 186, 193, 200, 204, 211, 215, 222, 229, 233, 240, 244, 251, 258, 262, 269, 276, 280, 287, 291, 298, 305, 309, 316, 320, 327
Offset: 1

Views

Author

Amiram Eldar, Feb 27 2021

Keywords

Comments

Brown (1969) proved that every positive number has a unique representation as a sum of non-consecutive Lucas numbers, if L(0) = 2 and L(2) = 3 do not appear simultaneously in the representation.
Chu et al. (2020) proved that if L(0) and L(2) are allowed to appear simultaneously, then each positive number can have at most two representations. The terms with two representations are listed in this sequence. They found that the number of terms that do not exceed 10^k, for k = 1, 2, ..., are 1, 17, 171, 1708, 17082, 170820, ..., and proved that the asymptotic density of this sequence is 1/(3*phi+1) = 0.1708203932... (A176015 - 1), where phi is the golden ratio (A001622).
A number n appears in the sequence if and only if the coefficient of phi^{-1} in the base-phi expansion of n is 1. Alternatively, the last bit of the n-th term of A341722 is 1. - Jeffrey Shallit, May 03 2023

Examples

			5 is a term since it has two representations: L(0) + L(2) = 2 + 3 and L(1) + L(3) = 1 + 4.
12 is a term since it has two representations: L(1) + L(5) = 1 + 11 and L(0) + L(2) + L(4) = 2 + 3 + 7.
		

Crossrefs

Programs

  • Java
    See David C. Luo's GitHub link.
  • Maple
    L:= [seq(combinat:-fibonacci(n+1)+combinat:-fibonacci(n-1), n=0..40)]:
    f1:= proc(n, m) option remember;
          if n = 0 then return 1 fi;
          if m <= 0 then 0
          elif L[m] <= n then procname(n - L[m],m-2) + procname(n, m-1)
          else procname(n,m-1)
          fi
    end proc:
    filter:= n -> f1(n,ListTools:-BinaryPlace(L,n+1))=2:
    select(filter, [$1..1000]); # Robert Israel, Mar 10 2021
  • Mathematica
    L = Table[Fibonacci[n+1] + Fibonacci[n-1], {n, 0, 40}];
    f1[n_, m_] := f1[n, m] = If[n == 0, Return[1], Which[m <= 0, 0, L[[m]] <= n, f1[n-L[[m]], m-2] + f1[n, m-1], True, f1[n, m-1]]];
    filterQ[n_] := f1[n, FirstPosition[L, b_ /; b > n+1][[1]]-1] == 2;
    Select[Range[1000], filterQ] (* Jean-François Alcover, Aug 27 2022, after Robert Israel *)

A367816 Number of terms in a shortest sequence of Lucas numbers that sum to n, allowing Lucas numbers with negative indices.

Original entry on oeis.org

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

Views

Author

Mike Speciner, Dec 01 2023

Keywords

Examples

			For n = 0, the empty sequence sums to 0, so a(0) = 0.
For n = 1, 2, 3, 4, 7, 11, 18, each n is a Lucas number, so a(n) = 1.
The first n needing a negative-index Lucas number is 17 = 18 + -1; a(17) = 2.
		

Crossrefs

Cf. A000032 Lucas numbers; A061084 negative index Lucas numbers.
A116543 is the similar sequence where negative index Lucas numbers are not allowed.
a(A365907(n)) is the first occurrence of n.

Programs

  • Python
    from itertools import count
    def  a(n) :
      """For integer n, the least number of Lucas terms required to sum to n."""
      f = [2,1];    # Lucas numbers, starting with Lucas(0)
      while f[-1] <= (n or 1) :
        f.append(f[-2]+f[-1]);
      a = [0 for _ in range(f[-1]+1)];
      for i in f :
        a[i] = 1;
      for c in count(2) :
        if not all(a[4:]) :
          for i in range(4,f[-1]) :
            if not a[i] :
              for j in f :
                if j >= i :
                  break;
                if a[i-j] == c-1 :
                  a[i] = c;
                  break;
              if not a[i]:
                for j in f[1::2] :
                  if i+j >= len(a) :
                    break;
                  if a[i+j] == c-1 :
                    a[i] = c;
                    break;
        else :
          break;
      return a[n];

Formula

a(0) = 0; a(A000032(n)) = 1.
For n > 0, a(n) = 1+min(a(n-Lucas(k))) where k ranges over Z.

A368594 Number of Lucas numbers needed to get n by addition and subtraction.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3
Offset: 0

Views

Author

Mike Speciner, Dec 31 2023

Keywords

Comments

The definition does not require the Lucas numbers to be distinct, but it is easy to show that a(n) distinct Lucas numbers can get n by addition and subtraction, based on the identity 2*Lucas(n) = Lucas(n+1)+Lucas(n-2).

Examples

			a(0) = 0, as it is the empty sum of Lucas numbers.
a(1) = a(2) = a(3) = a(4) = 1, as they are all Lucas numbers.
a(5) = 2, since 5 = 1 + 4 = 2 + 3.
The first term requiring a subtraction is a(16): 16 = 18 - 2.
		

Crossrefs

Cf. A000032 (Lucas numbers).
Cf. A364754 (indices of record highs).
Cf. A367816, A116543 (where only addition is allowed).
Cf. A058978 (for Fibonacci numbers).

Programs

  • Python
    from itertools import count
    def a(n) :
      """For integer n, the least number of signed Lucas terms required to sum to n."""
      f = [2, 1];    # Lucas numbers, starting with Lucas(0)
      while f[-1] <= (n or 1) :
        f.append(f[-2]+f[-1])
      a = [0 for _ in range(f[-1]+1)]
      for i in f :
        a[i] = 1
      for c in count(2) :
        if not all(a[4:]) :
          for i in range(4, f[-1]) :
            if not a[i] :
              for j in f :
                if j >= i :
                  break
                if a[i-j] == c-1 :
                  a[i] = c
                  break
              if not a[i]:
                for j in f :
                  if i+j >= len(a) :
                    if j != 2:
                      break
                  elif a[i+j] == c-1 :
                    a[i] = c
                    break;
        else :
          break
      return a[n]

Formula

a(0) = 0; a(A000032(n)) = 1.
a(n) = 1 + min_{k>=0} min(a(n-Lucas(k)), a(n+Lucas(k))), for n >= 1.
Previous Showing 11-16 of 16 results.