A131851 Real part of the function z(n)=Sum(d(k)*i^k: d as in n=Sum(d(k)*2^k), i=sqrt(-1)).
0, 1, 0, 1, -1, 0, -1, 0, 0, 1, 0, 1, -1, 0, -1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, -1, 0, -1, 0, 0, 1, 0, 1, -1, 0, -1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, -1, 0, -1, 0, -2, -1, -2, -1, -1, 0, -1, 0, -2, -1, -2, -1, 0, 1, 0, 1, -1, 0, -1, 0, 0, 1, 0, 1, -1, 0, -1, 0, -1, 0, -1, 0, -2, -1, -2, -1, -1, 0, -1, 0, -2, -1, -2
Offset: 0
Keywords
Links
- R. Zumkeller, Table of n, a(n) for n = 0..10000
Crossrefs
Cf. A007088.
Programs
-
Mathematica
z[0] = 0; z[n_] := z[n] = z[Floor[n/2]]*I + Mod[n, 2]; Table[z[n] // Re, {n, 0, 110}] (* Jean-François Alcover, Jul 03 2013 *)
Formula
z(n) = if n=0 then (0, 0) else z(floor(n/2))*(0, 1) + (n mod 2, 0), complex multiplication.
Comments