A320042 a(n) = a(floor(n/2)) + (-1)^(n*(n+1)/2) with a(1)=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
Offset: 1
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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}]
-
PARI
a(n) = if (n==1, 0, a(n\2) + (-1)^(n*(n+1)/2)); \\ Michel Marcus, Oct 05 2018
Extensions
More terms from Michel Marcus, Oct 05 2018
Comments