Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #36 Jan 01 2020 22:04:24
%S 1,0,1,2,1,0,1,0,1,2,1,2,1,0,1,2,1,2,3,4,3,2,3,2,3,4,3,2,3,4,5,4,5,6,
%T 5,4,5,4,5,6,5,6,5,4,5,6,5,6,7,8,7,6,7,6,7,8,7,6,7,6,5,4,5,6,5,6,5,4,
%U 5,6,5,4,3,4,3,2,3,4,3,4,3,2,3,2,3,4,3,2,3,2,1,0,1,2,1,2,1,0,1,2
%N Partial sums of A283131.
%C There appears to be (on average) slightly more 1 (forward steps) than -1 (backward steps) in A283131: the partial sums keep slowly increasing (as a global trend), though non-monotically.
%C The average (from 1 to n) of the partial sums keeps increasing (as a global trend), though non-monotically. Furthermore, it appears that the average (from 1 to n) of partial sums is always positive.
%C Average (from 1 to n) of the partial sums:
%C 1 to 10000: 2.674
%C 1 to 20000: 5.908
%C 1 to 30000: 8.866
%C 1 to 40000: 9.1975
%C 1 to 50000: 10.511
%C Those averages seem to be asymptotic to some strictly increasing concave [yet unknown] function.
%C The first negative partial sum is a(103) = -1.
%C First occurrence of k beginning at -8: 1406, 1405, 1186, 1183, 326, 325, 106, 103, 2, 1, 4, 19, 20, 31, 34, 49, 50, 2817, 3264, 4121, 4124, 4343, 4344, 12857, 14552, 14553, 15368, 15375, 15386, 15597, 15598, 15609, 21344, 21563, 21564, 46907, 46918, 47129, 47130, 47141, ..., . _Robert G. Wilson v_, Mar 19 2017
%H Daniel Forgues, <a href="/A283144/b283144.txt">Table of n, a(n) for n = 1..50000</a>
%H Robert G. Wilson v, <a href="/A283144/a283144.pdf">Graph of the first 50000 terms.</a>
%t a[1] = 1; a[2] = -1; suffix[lst_] := If[ MatchQ[lst, {___, b__, b__}], lst /. {___, b__, b__} :> {b}, {}]; a[n_] := a[n] = Module[{aa, lg1, lg2}, aa = Array[a, n - 1]; lg1 = suffix[Append[aa, 1]] // Length; lg2 = suffix[Append[aa, -1]] // Length; If[lg1 <= lg2, 1, -1]]; Accumulate@Array[a, 100] (* _Robert G. Wilson v_, Mar 19 2017 after _Jean-François Alcover_ in A006345 *)
%Y Cf. A006345, A283131.
%K sign
%O 1,4
%A _Daniel Forgues_, Mar 01 2017