|
| |
|
|
A053985
|
|
Replace 2^k with (-2)^k in binary expansion of n.
|
|
12
| |
|
|
0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, 16, 17, 14, 15, 20, 21, 18, 19, 8, 9, 6, 7, 12, 13, 10, 11, -32, -31, -34, -33, -28, -27, -30, -29, -40, -39, -42, -41, -36, -35, -38, -37, -16, -15, -18, -17, -12, -11, -14, -13, -24, -23, -26, -25, -20, -19
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,3
|
|
|
COMMENTS
| Base 2 representation for n (in lexicographic order) converted from base -2 to base 10.
Maps natural numbers uniquely onto integers; within each group of positive values, maximum is in A002450; a(n)=n iff n can be written only with 1's and 0's in base 4 (A000695)
a(n) = A004514(n) - n. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 27 2003
|
|
|
LINKS
| R. Stephan, Some divide-and-conquer sequences ...
R. Stephan, Table of generating functions
|
|
|
FORMULA
| G.f. 1/(1-x) * sum(k>=0, (-2)^k*x^2^k/(1+x^2^k)). a(0) = 0, a(2n) = -2a(n), a(2n+1) = -2a(n)+1. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Jun 13 2003
a(n)=Sum_k>=0 {A030308(n,k)*A122803(k)}. - From DELEHAM Philippe, Oct 15 2011.
|
|
|
EXAMPLE
| a(9)=-7 because 9 is written 1001 base 2 and (-2)^3+(-2)^0=-8+1=-7
|
|
|
MATHEMATICA
| f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 2]], {n, 1, 80}]; b
|
|
|
CROSSREFS
| Inverse of A005351. Cf. A039724, A007088, A065369, A073791, A073792, A073793, A073794, A073795, A073796 and A073835.
Sequence in context: A090077 A163509 A161399 * A091564 A191379 A038574
Adjacent sequences: A053982 A053983 A053984 * A053986 A053987 A053988
|
|
|
KEYWORD
| base,easy,sign
|
|
|
AUTHOR
| Henry Bottomley (se16(AT)btinternet.com), Apr 03 2000
|
| |
|
|