OFFSET
2,3
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.
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).
EXAMPLE
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,
...
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);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Bala, Sep 11 2022
STATUS
approved