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

A256655 R(k), the minimal alternating Fibonacci representation of k, concatenated for k = 0, 1, 2,....

Original entry on oeis.org

0, 1, 2, 3, 5, -1, 5, 8, -2, 8, -1, 8, 13, -5, 1, 13, -3, 13, -2, 13, -1, 13, 21, -8, 1, 21, -8, 2, 21, -5, 21, -5, 1, 21, -3, 21, -2, 21, -1, 21, 34, -13, 1, 34, -13, 2, 34, -13, 3, 34, -13, 5, -1, 34, -8, 34, -8, 1, 34, -8, 2, 34, -5, 34, -5, 1, 34, -3, 34
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

Suppose that b = (b(0), b(1), ... ) is an increasing sequence of positive integers satisfying b(0) = 1 and b(n+1) <= 2*b(n) for n >= 0. Let B(n) be the least b(m) >= n. Let R(0) = 1, and for n > 0, let R(n) = B(n) - R(B(n) - n). The resulting sum of the form R(n) = B(n) - B(m(1)) + B(m(2)) - ... + ((-1)^k)*B(k) is introduced here as the minimal alternating b-representation of n. The sum B(n) + B(m(2)) + ... we call the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... , the nonpositive part of R(n). The number ((-1)^k)*B(k) is the trace of n.
If b(n) = F(n+2), where F = A000045, then the sum is the minimal alternating Fibonacci-representation of n.

Examples

			R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 3
R(4) = 5 - 1
R(9) = 13 - 5 + 1
R(25) = 34 - 13 + 5 - 1
R(64) = 89 - 34 + 13 - 5 + 1
		

Crossrefs

Cf. A000045, A255973 (trace), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654, A256696 (minimal alternating binary representations), A255974 (minimal alternating triangular-number representations), A256789 (minimal alternating squares representations).

Programs

  • Mathematica
    f[n_] = Fibonacci[n]; ff = Table[f[n], {n, 1, 70}];
    s[n_] := Table[f[n + 2], {k, 1, f[n]}];
    h[0] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[12]; r[0] = {0};
    r[n_] := If[MemberQ[ff, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Flatten[Table[r[n], {n, 0, 60}]]

Formula

R(F(k)^2) = F(2k-1) - F(2k-3) + F(2k-5) - ... + d*F(5) + (-1)^k, where d = (-1)^(k+1).

A087172 Greatest Fibonacci number that does not exceed n.

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 5, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55
Offset: 1

Views

Author

Sam Alexander, Oct 19 2003

Keywords

Comments

Also the largest term in Zeckendorf representation of n; starting at Fibonacci positions the sequence is repeated again and again in A107017: A107017(A000045(n)+k) = a(k) with 0 < k < A000045(n-1). - Reinhard Zumkeller, May 09 2005
Fibonacci(n) occurs Fibonacci(n-1) times, for n >= 2. - Benoit Cloitre, Dec 15 2022

Crossrefs

Programs

  • Haskell
    a087172 = head . a035516_row -- Reinhard Zumkeller, Mar 10 2013
  • Maple
    with(combinat):
    A087172 := proc (n) local j: for j while fibonacci(j) <= n do fibonacci(j) end do: fibonacci(j-1) end proc:
    seq(A087172(n), n = 1 .. 40); # Emeric Deutsch, Nov 11 2014
    # Alternative
    N:= 100: # to get a(n) for n from 1 to N
    Fibs:= [seq(combinat:-fibonacci(i), i = 1 .. ceil(log[(1 + sqrt(5))/2](sqrt(5)*N)))]:
    A:= Vector(N):
    for i from 1 to nops(Fibs)-1 do
      A[Fibs[i] .. min(N,Fibs[i+1]-1)]:= Fibs[i]
    od:
    convert(A,list); # Robert Israel, Nov 11 2014
  • Mathematica
    With[{rf=Reverse[Fibonacci[Range[10]]]},Flatten[Table[ Select[ rf,n>=#&, 1],{n,80}]]] (* Harvey P. Dale, Dec 08 2012 *)
    Flatten[Map[ConstantArray[Fibonacci[#],Fibonacci[#-1]]&,Range[15]]] (* Peter J. C. Moses, May 02 2022 *)
  • PARI
    a(n)=my(k=log(n)\log((1+sqrt(5))/2)); while(fibonacci(k)<=n, k++); fibonacci(k--) \\ Charles R Greathouse IV, Jul 24 2012
    

Formula

a(n) = Fibonacci(A130233(n)) = Fibonacci(A130234(n+1)-1). - Hieronymus Fischer, May 28 2007
a(n) = A035516(n, 0) = A035517(n, A007895(n)-1). - Reinhard Zumkeller, Mar 10 2013
a(n) = n - A066628(n). - Michel Marcus, Feb 02 2016
Sum_{n>=1} 1/a(n)^2 = Sum_{n>=1} Fibonacci(n)/Fibonacci(n+1)^2 = 1.7947486789... . - Amiram Eldar, Aug 16 2022

A255973 Trace of the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

0, 1, 2, 3, -1, 5, -2, -1, 8, 1, -3, -2, -1, 13, 1, 2, -5, 1, -3, -2, -1, 21, 1, 2, 3, -1, -8, 1, 2, -5, 1, -3, -2, -1, 34, 1, 2, 3, -1, 5, -2, -1, -13, 1, 2, 3, -1, -8, 1, 2, -5, 1, -3, -2, -1, 55, 1, 2, 3, -1, 5, -2, -1, 8, 1, -3, -2, -1, -21, 1, 2, 3, -1
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions.

Examples

			Let R(k) be the minimal alternating Fibonacci representation of k.  The trace of R(k) is the last term.
R(1) = 1, trace = 1
R(2) = 2, trace = 2
R(3) = 3, trace = 3
R(4) = 5 - 1, trace = -1
R(5) = 5, trace = 5
R(6) = 6 - 2, trace = -2
		

Crossrefs

Cf. A000045, A256655 (representations R(n)), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654.

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[12];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Last[r[n]], {n, 0, 200}]  (* A255973 *)

A333907 For n >= 1, a(n) = Sum_{k=1..n} prevfib(k) + nextfib(k) - 2*k, where prevfib(k) is the largest Fibonacci number < k, nextfib(k) is the smallest Fibonacci number > k.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 2, 4, 7, 8, 7, 4, 7, 13, 17, 19, 19, 17, 13, 7, 12, 23, 32, 39, 44, 47, 48, 47, 44, 39, 32, 23, 12, 20, 39, 56, 71, 84, 95, 104, 111, 116, 119, 120, 119, 116, 111, 104, 95, 84, 71, 56, 39, 20, 33, 65, 95, 123, 149, 173, 195, 215, 233, 249, 263, 275
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 09 2020

Keywords

Examples

			a(1) = (0 + 2 - 2*1) = 0;
a(2) = (0 + 2 - 2*1) + (1 + 3 - 2*2) = 0;
a(3) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) = 1;
a(4) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) + (3 + 5 - 2*4) = 1.
		

Crossrefs

Programs

  • PARI
    isfib(k) = my(m=5*k^2); issquare(m-4) || issquare(m+4);
    nextfib(n) = my(k=n+1); while (!isfib(k), k++); k;
    prevfib(n) = my(k=n-1); while (!isfib(k), k--); k;
    a(n) = sum(k=1, n, prevfib(k) + nextfib(k) - 2*k); \\ Michel Marcus, Apr 10 2020
Showing 1-4 of 4 results.