login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A305299 a(0) = 0, a(1) = 1, a(2) = 2; for n >= 2, a(2*n-1) = n - 2*a(n-1) - 1, a(2*n) = a(2*n-1) - a(n). 2
0, 1, 2, -1, -3, -2, -1, 5, 8, 10, 12, 9, 10, 8, 3, -3, -11, -8, -18, -11, -23, -14, -23, -7, -17, -8, -16, -3, -6, 8, 11, 21, 32, 38, 46, 33, 51, 54, 65, 41, 64, 66, 80, 49, 72, 68, 75, 37, 54, 58, 66, 41, 57, 58, 61, 33, 39, 40, 32, 13, 2, 8, -13, -11, -43, -32, -70, -43, -89, -58, -91, -31, -82, -66, -120, -71, -136, -92 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

This sequence has an approximate self-similar block structure, which is roughly described by A110286, see Links section.

a(0) = 0 by definition. The next 0 is a(970) = 0. What are the other numbers k such that a(k) = 0?

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

Rémy Sigrist, Density plot of the first 16000000 terms

Altug Alkan, A scatterplot of a(n) for n <= 15*2^12

Altug Alkan, A scatterplot of a(n) for 15*2^12 <= n <= 15*2^14

MAPLE

f:= proc(n) option remember;

  if n::odd then (n-1)/2-2*procname((n-1)/2)

  else procname(n-1)-procname(n/2)

  fi

end proc:

f(0):= 0: f(1):= 1: f(2):= 2:

map(f, [$0..77]); # after Robert Israel at A294044

MATHEMATICA

a[0] = 0; a[1] = 1; a[2] = 2; a[n_] := If[EvenQ[n], a[n - 1] - a[n/2],  (n - 1)/2 - 2 a[(n - 1)/2]]; Table[a[n], {n, 0, 77}] (* after Ilya Gutkovskiy at A294044 *)

PROG

(PARI) a(n)=if(n<=2, n, if(n%2==1, (n-1)/2-2*a((n-1)/2), a(n-1)-a(n/2)));

(PARI) a = vector(77); print1 (0", "); for (k=1, #a, print1 (a[k]=if (k<=2, k, my (n=k\2); if (k%2==0, a[2*n-1]-a[n], n-2*a[n]))", ")) \\ after Rémy Sigrist at A303028

CROSSREFS

Cf. A002487, A294044, A303028.

Sequence in context: A152097 A119442 A064861 * A308701 A191528 A191788

Adjacent sequences:  A305296 A305297 A305298 * A305300 A305301 A305302

KEYWORD

sign,look

AUTHOR

Altug Alkan, Aug 18 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 19 10:53 EDT 2021. Contains 347556 sequences. (Running on oeis4.)