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.

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

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 3, 3, 3, 2, 2, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 4, 3, 3, 3, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 11, 10, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11
Offset: 2

Views

Author

Peter Bala, Sep 11 2022

Keywords

Comments

The line graph of the sequence consists of a series of local plateaus and local troughs joined at each end by lines of slope 1 and slope -1. More precisely, for k >= 3 the graph of the sequence consists of
a) local plateaus: on the integer interval [2*F(k), 2*F(k) + 2*F(k-3)] the sequence has the constant value F(k-2), where F(n) denotes the n-th Fibonacci number
b) descent to a trough: on the integer interval [2*F(k) + 2*F(k-3), F(k+2)] the line graph of the sequence has slope -1
c) local troughs: on the integer interval [F(k+2), F(k+2) + F(k-3)] the sequence has the constant value F(k-3)
d) ascent to a plateau: on the integer interval [F(k+2) + F(k-3), 2*F(k+1)] the line graph of the sequence has slope 1.

Examples

			The sequence is arranged to show the local plateaus (P) and the local troughs (T):
    0,
    1,
    1,
T   0,
P   1, 1, 1
    1,
P   2, 2, 2,
T   1,1,
    2,
P   3, 3, 3, 3, 3,
T   2, 2, 2,
    3,
    4,
P   5, 5, 5, 5, 5, 5, 5,
    4,
T   3, 3, 3, 3,
    4,
    5,
    6,
    7,
P   8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    7,
    6,
T   5, 5, 5, 5, 5, 5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
P   13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
    12,
    11,
    10,
    9,
T   8, 8, 8, 8, 8, 8, 8, 8, 8,
    9,
    10,
    11,
    ...
		

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 - b(n))), n = 2..100);

Formula

a(n+1) - a(n) = 1, 0 or -1.
Let F(n) = A000045(n) with F(-1) = 1 and let L(n) = A000032(n).
For k >= 5, a(F(k) + j) = F(k-5) for 0 <= j <= F(k-5) (troughs).
For k >= 4, a(2*F(k) + j) = F(k-2) for 0 <= j <= 2*F(k-3) (plateaus).