A356999 a(n) = 2*A356988(n) - n.
1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 19, 18, 17, 16, 15, 14, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 33, 32
Offset: 1
Examples
The sequence arranged as a series of alternating monotone increasing and decreasing sequences: 1; 0; 1, 2; 1; 2, 3; 2; 3, 4, 5; 4, 3; 4, 5, 6, 7, 8; 7, 6, 5; 6, 7, 8, 9, 10, 11, 12, 13; 12, 11, 10, 9, 8; 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21; 20, 19, 18, 17, 16, 15, 14, 13; 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, ..., 32, 33, 34; 33, 32, 31, ..., 23, 22, 21;
Programs
-
Maple
# b(n) = A356988(n) 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(2*b(n) - n, n = 1..100);
Formula
a(n+1) - a(n) is either 1 or -1.
The sequence is completely determined by the pair of formulas
1) for k >= 2, a(F(k) + j) = F(k-3) + j for 0 <= j <= F(k-2) and
2) for k >= 1, a(L(k) + j) = F(k) - j for 0 <= j <= F(k-2),
Comments