OFFSET
0,4
COMMENTS
The median of an even number of terms is taken as the mean of its middle two values, (x+y)/2.
The sequence seems to present a chaotic pattern. What is its asymptotic behavior?
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Thomas Scheuerle, Plot a(0)..a(20000).
Thomas Scheuerle, Plot n = 0..200000, blue: a(n)/10, red: mean(a(0)..a(n)), orange: 10*(median(a(0)..a(n))-mean(a(0)..a(n))). We observe new emergent chaos after periods of apparent calming.
MAPLE
R:= [0, 1]:
for i from 2 to 10000 do
v:= R[-1] - 1 + floor(Statistics:-Median(R) - Statistics:-Mean(R));
R:= [op(R), v]
od:
R; # Robert Israel, Oct 14 2024
MATHEMATICA
a = {0, 1};
Do[AppendTo[a, Last[a] - 1 + Floor[Median[a] - Mean[a]]], {j, 1, 100}]
a[[1 ;; 100]]
PROG
(MATLAB)
function a = A365819( max_n )
a = [0 1];
for n = 3:max_n
a(n) = a(n-1) - 1 + floor(median(a) - mean(a));
end
end % Thomas Scheuerle, Dec 15 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Andres Cicuttin, Dec 14 2023
STATUS
approved