Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #15 Nov 26 2020 09:16:15
%S 1,1,1,1,-1,1,1,-1,1,-1,1,1,-1,1,-1,1,-1,1,-1,1,1,-1,1,-1,1,-1,1,-1,1,
%T -1,1,-1,1,-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,
%U -1,1,-1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1
%N Signs of first differences of A076042.
%C The sequence of first differences of A076042 is this sequence times n^2. After the first five entries, the sequence consists mostly of alternating 1 and -1, with an increasingly rare extra 1.
%F A076042(n) = A076042(n-1) + a(n)*(n^2).
%e A076042(10) - A076072(9) = 7 - 107 = -100 = (-1)*(11^2), so a(10) = -1.
%p b:= proc(n) option remember; `if`(n=0, 0, (t->
%p t+`if`(t<n^2, 1, -1)*n^2)(b(n-1)))
%p end:
%p a:= n-> signum(b(n)-b(n-1)):
%p seq(a(n), n=1..105); # _Alois P. Heinz_, Sep 08 2019
%t b[n_] := b[n] = If[n==0, 0, b[n-1] + If[b[n-1] < n^2, n^2, -n^2]];
%t b /@ Range[0, 100] // Differences // Sign (* _Jean-François Alcover_, Nov 26 2020 *)
%Y Cf. A076042.
%K easy,sign
%O 1
%A _Allan C. Wechsler_, Sep 08 2019