login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053985 Replace 2^k with (-2)^k in binary expansion of n. 15
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; text; 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, Dec 27 2003

LINKS

Table of n, a(n) for n=0..61.

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

FORMULA

From Ralf Stephan, Jun 13 2003: (Start)

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. (End)

a(n) = Sum_{k>=0} A030308(n,k)*A122803(k). - Philippe Deléham, 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

PROG

(PARI) a(n) = fromdigits(binary(n), -2) \\ Rémy Sigrist, Sep 01 2018

CROSSREFS

Inverse of A005351. Cf. A039724, A007088, A065369, A073791, A073792, A073793, A073794, A073795, A073796 and A073835.

Sequence in context: A163509 A161399 A318479 * A091564 A191379 A038574

Adjacent sequences:  A053982 A053983 A053984 * A053986 A053987 A053988

KEYWORD

base,easy,sign

AUTHOR

Henry Bottomley, Apr 03 2000

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 23:07 EDT 2018. Contains 316327 sequences. (Running on oeis4.)