OFFSET
2,9
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
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)
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
local troughs: on the integer interval [F(k+2), F(k+2) + F(k-3)] the sequence has the constant value F(k-3)
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.
FORMULA
EXAMPLE
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,
...
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);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Bala, Sep 11 2022
STATUS
approved