OFFSET
2,3
COMMENTS
a(n+1) - a(n) is equal to 1 or -1.
The following hold for k >= 0:
Local valley: at n = 5*(2^k) the sequence has a local minimum value of 2^k.
Ascent: on the interval [5*(2^k), 8*(2^k)] of length 3*(2^k) the line graph of the sequence has slope 1.
Local peak: at n = 8*(2^k) the sequence has a local maximum value of 4*(2^k).
Descent: on the interval [8*(2^k), 10*(2^k)] of length 2*(2^k) the line graph of the sequence has slope -1.
Local valley: at n = 10*(2^k) = 5*(2^(k+1)) the sequence has a local minimum value of 2^(k+1).
LINKS
Peter Bala, Notes on A357564
FORMULA
a(2) = 0, a(3) = 1 and a(4) = 2. For k >= 0 there holds
a(5*2^k + j) = 2^k + j for 0 <= j <= 3*2^k and
a(8*2^k + j) = 4*2^k - j for 0 <= j <= 2*2^k.
MAPLE
# b(n) = A006165(n)
b := proc(n) option remember; if n = 1 then 1 else n - b(n - b(b(n-1))) end if; end proc:
seq( n - 2*b(b(n)), n = 2..100);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Bala, Oct 15 2022
STATUS
approved