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.

A356998 a(n) = b(n) - b(n - b(n)) for n >= 2, where b(n) = A356988(n).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 3, 4, 5, 6, 5, 5, 6, 7, 8, 9, 10, 9, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 15, 14, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 25, 24, 23, 22, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 41, 40, 39, 38, 37, 36, 35, 34, 34, 34, 34, 34, 34, 35, 36, 37
Offset: 2

Views

Author

Peter Bala, Sep 11 2022

Keywords

Comments

The line graph of the sequence rises with slope 1 to a local peak value at heights 4, 6, 10, 16, 26, 42, ..., the sequence {2*Fibonacci(k): k >= 3}, before descending with slope -1 to a local trough at heights 3, 5, 8, 13, 21, ..., the sequence {Fibonacci(k): k >= 4}.
The local peaks of the graph occur at abscissa values n = 7, 11, 18, 29, 47, 76, ..., the sequence {Lucas(k): k >= 4}.
The trough of height F(k) starts at abscissa n = 4*F(k-1) and ends at abscissa n = F(k+2).
The sequence of trough lengths starting at abscissa n = 8 begin 0, 1, 1, 2, 3, 5, 8, 13, ..., the Fibonacci sequence A000045.

Examples

			Sequence arranged to show local peak values P and troughs T:
     0,
     1,
     2,
     2,
     3,
  P  4,
  T  3,
     4,
     5,
  P  6,
  T  5, 5,
     6,
     7,
     8,
     9,
  P  10,
     9,
  T  8, 8,
     9,
     10,
     11,
     12,
     13,
     14,
     15,
  P  16,
     15,
     14,
  T  13, 13, 13,
     14,
     15,
     16,
     17,
     18,
     19,
     20,
     21,
     22,
     23,
     24,
     25,
  P  26,
     25,
     24,
     23,
     22,
  T  21, 21, 21, 21,
     22,
     23,
     24,
     ...
		

Crossrefs

Programs

  • Maple
    # b(n) = A356988
    b := proc(n) option remember; if n = 1 then 1 else n - b(b(n - b(b(b(n-1))))) end if; end proc:
    seq( b(n) - b(n - b(n)), n = 1..100);

Formula

a(n+1) - a(n) = 1, 0 or -1.
Let F(n) = Fibonacci(n) and L(n) + Lucas (n).
For k >= 5, a(F(k) + j) = F(k-2) + j for 0 <= j <= F(k-2) (ascent to local peak value).
For k >= 3, a(L(k)) = 2*F(k-1) (local peak values).
For k >= 4, a(L(k) + j) = 2*F(k-1) - j, for 0 <= j <= F(k-3) (descent to trough).
For k >= 2, a(4*F(k) + j) = F(k+1) for 0 <= j <= F(k-3) (local trough values).