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!)
A323186 a(0) = 0, a'(0) = 0, a''(0) = 1, a''(1) = -1, a(n) = a(n-1) + a'(n), a'(n) = a'(n-1) + a''(n), a''(n) = -a''(n-1) if a(n-2) = 0, or else a''(n-1). 2

%I #31 Dec 19 2019 05:49:56

%S 0,-1,-1,0,2,3,3,2,0,-3,-5,-6,-6,-5,-3,0,4,7,9,10,10,9,7,4,0,-5,-9,

%T -12,-14,-15,-15,-14,-12,-9,-5,0,6,11,15,18,20,21,21,20,18,15,11,6,0,

%U -7,-13,-18,-22,-25,-27,-28,-28,-27,-25,-22,-18,-13,-7,0,8,15,21,26,30,33,35,36,36,35,33,30,26,21,15,8,0,-9,-17,-24,-30,-35,-39,-42,-44,-45,-45,-44,-42,-39,-35,-30,-24,-17,-9,0

%N a(0) = 0, a'(0) = 0, a''(0) = 1, a''(1) = -1, a(n) = a(n-1) + a'(n), a'(n) = a'(n-1) + a''(n), a''(n) = -a''(n-1) if a(n-2) = 0, or else a''(n-1).

%C This sequence might be called the "Bad Driver's Sequence" as it fully "accelerates" or "decelerates" when it changes side of its "speed limit".

%H Georg Fischer, <a href="/A323186/b323186.txt">Table of n, a(n) for n = 0..1000</a>

%F a'(n) = A053615(n)*(-1)^ceiling((sqrt(4n+1)-1)/2).

%F a''(n) = (-1)^ceiling(sqrt(n)).

%F a''(n) changes sign at A002522, a(n) = 0 at A005563.

%F a(n) has local extrema (with a'(n) = 0) at the oblong numbers A002378 with the value of A000217(n)*(-1)^n, the magnitude of which is the corresponding triangular number, as such |a(n)| <= n/2.

%e a''(0) = 1, a'(0) = 0, a(0) = 0.

%e a''(1) = -1, a'(1) = 0 - 1 = -1, a(1) = 0 - 1 = -1.

%e a(2-2) = a(0) = 0, so a''(2) = -a''(1) = 1, a'(2) = -1 + 1 = 0, a(2) = -1 + 0 = -1.

%o (Haskell)

%o a(0) = 0

%o a(1) = -1

%o a(2) = -1

%o a(n) = if a(n-2) == 0 then a(n-1) + a'(n-1) - a''(n-1) else a(n-1) + a'(n-1) + a''(n-1)

%o where a'(n) = a(n) - a(n-1)

%o a''(n) = a'(n) - a'(n-1)

%o (Perl)

%o my @a = (0, -1, -1);

%o for my $n (scalar(@a)..1000) {

%o if ($a[$n - 2] == 0) {

%o $a[$n] = $a[$n - 1] + &as($n - 1) - &ass($n - 1);

%o } else {

%o $a[$n] = $a[$n - 1] + &as($n - 1) + &ass($n - 1);

%o }

%o print "$n $a[$n]\n";

%o } # for n

%o sub as { my ($n) = @_; return $a[$n] - $a[$n - 1]; }

%o sub ass { my ($n) = @_; return &as($n) - &as($n - 1); }

%o # _Georg Fischer_, Feb 14 2019

%Y Cf. A000217, A000290, A002378, A002522, A005563.

%K sign,look

%O 0,5

%A _Thomas Anton_, Jan 06 2019

%E a(44) corrected [18, not -18] by _Tom Duff_, Feb 14 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 March 29 00:26 EDT 2024. Contains 371264 sequences. (Running on oeis4.)