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!)
A320042 a(n) = a(floor(n/2)) + (-1)^(n*(n+1)/2) with a(1)=0. 0
0, -1, 1, 0, -2, 0, 2, 1, -1, -3, -1, 1, -1, 1, 3, 2, 0, -2, 0, -2, -4, -2, 0, 2, 0, -2, 0, 2, 0, 2, 4, 3, 1, -1, 1, -1, -3, -1, 1, -1, -3, -5, -3, -1, -3, -1, 1, 3, 1, -1, 1, -1, -3, -1, 1, 3, 1, -1, 1, 3, 1, 3, 5, 4, 2, 0, 2, 0, -2, 0, 2, 0, -2, -4, -2, 0, -2, 0, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

For 2^(2*k-1) - 1 < n < 2^(2*k), k>0, there's no n such that a(n)=0.

For 2^(2*k) - 1 < n < 2^(2*k+1), k>0, there are A000984(k+1) n's such that a(n)=0.

LINKS

Table of n, a(n) for n=1..80.

FORMULA

a(1) = 0, a(n) = a(floor(n/2)) + (-1)^(n*(n+1)/2).

a(n) = 2*A092339(n+1) - A000523(n).

EXAMPLE

a(9) = a(4) + (-1)^45 = -1, a(10) = a(5) + (-1)^55 = -3.

For 7 < n < 16, there's no n such that a(n)=0; for 15 < n < 32, there are 6 n's such that a(n)=0.

MAPLE

a:=proc(n) `if`(n=1, 0, a(floor(n/2))+(-1)^(n*(n+1)/2)) end: seq(a(n), n=1..100); # Muniru A Asiru, Oct 07 2018

MATHEMATICA

a[1] = 0; a[n_] := a[n] = a[Floor[n/2]] + (-1)^(n*(n + 1)/2); Table[a@n, {n, 1, 50}]

PROG

(PARI) a(n) = if (n==1, 0, a(n\2) + (-1)^(n*(n+1)/2)); \\ Michel Marcus, Oct 05 2018

CROSSREFS

Cf. A000523, A000984, A007088, A092339.

Sequence in context: A302172 A249338 A046069 * A055651 A175929 A079627

Adjacent sequences:  A320039 A320040 A320041 * A320043 A320044 A320045

KEYWORD

sign

AUTHOR

Jinyuan Wang, Oct 03 2018

EXTENSIONS

More terms from Michel Marcus, Oct 05 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 August 9 11:08 EDT 2020. Contains 336323 sequences. (Running on oeis4.)