login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A325931 Signs of first differences of A076042. 1

%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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 5 19:57 EDT 2024. Contains 372284 sequences. (Running on oeis4.)