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!)
A318303 a(0) = 0, a(n) = n + a(n-1) if n is odd, a(n) = -3*a(n/2) if n is even. 3
0, 1, -3, 0, 9, 14, 0, 7, -27, -18, -42, -31, 0, 13, -21, -6, 81, 98, 54, 73, 126, 147, 93, 116, 0, 25, -39, -12, 63, 92, 18, 49, -243, -210, -294, -259, -162, -125, -219, -180, -378, -337, -441, -398, -279, -234, -348, -301, 0, 49, -75, -24, 117, 170, 36, 91, -189, -132, -276, -217, -54, 7, -147, -84, 729, 794, 630 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Let g_k(0) = 0. g_k(n) = n + g_k(n-1) if n is odd, g_k(n) = k*a(n/2) if n is even. A228451(n) is g_1(n), A298011(n) is g_2(n). This sequence is a(n) = g_k(n) where k = -3.
LINKS
Rémy Sigrist, Colored scatterplot of a(n) for n = 0..1000000 (where the color is function of A262304(n))
Rémy Sigrist, Colored scatterplot of a(n) for n = 0..1000000 (where the color is function of floor(n / 2^(A070939(n) - 6)))
Rémy Sigrist, A colored scatterplot of (A317825(n), abs(A318303(n))) for n = 1..2^20-1 (where the color is function of floor(n / 2^(A070939(n)-5)))
MATHEMATICA
Nest[Append[#1, If[OddQ@ #2, #2 + #1[[-1]], -3 #1[[#2/2 + 1]] ]] & @@ {#, Length@ #} &, {0}, 66] (* Michael De Vlieger, Aug 25 2018 *)
PROG
(PARI) a(n)=if(n==0, 0, if(n%2, n+a(n-1), -3*a(n/2)));
CROSSREFS
Sequence in context: A118534 A187427 A167352 * A336710 A294106 A094472
KEYWORD
sign,look
AUTHOR
Altug Alkan, Aug 24 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 21:53 EDT 2024. Contains 372317 sequences. (Running on oeis4.)