OFFSET
0,3
COMMENTS
This sequence is the "tier profile" of A076042, much as A064289 provides a similar profile of Recamán's Sequence (A005132). In each case, the base sequence jumps around between adjacent "tiers", each of which changes value relatively slowly (compared to the difference between entries in different tiers). As in Recamán's sequence, each tier rises for a while, then crests, and finally falls close to zero, at which point that tier becomes extinct. The tier structure is salient when viewing the graph of such a sequence.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..65536
FORMULA
a(0) = 0; a(n) = a(n-1) + A325931(n).
EXAMPLE
a(20) = a(19) + A325931(20) = 5 + 1 = 6.
MAPLE
b:= proc(n) option remember; `if`(n=0, 0, (t->
t+`if`(t<n^2, 1, -1)*n^2)(b(n-1)))
end:
a:= proc(n) option remember; `if`(n=0, 0,
a(n-1)+signum(b(n)-b(n-1)))
end:
seq(a(n), n=0..105); # Alois P. Heinz, Sep 08 2019
MATHEMATICA
b[n_] := b[n] = If[n == 0, 0, b[n - 1] + If[b[n - 1] < n^2, n^2, -n^2]];
b /@ Range[0, 105] // Differences // Sign // Accumulate // Prepend[#, 0]& (* Jean-François Alcover, Nov 30 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Allan C. Wechsler, Sep 08 2019
STATUS
approved