login
A356997
a(n) = b(n) - b(n - b(n - b(n))) for n >= 2, where b(n) = A356988(n).
2
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,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
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).
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