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!)
A318702 For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let f(n) = Sum_{k=0..w} b_k * i^k * 2^floor(k/2) (where i denotes the imaginary unit); a(n) is the real part of f(n). 3
0, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0, 1, -2, -1, -2, -1, 4, 5, 4, 5, 2, 3, 2, 3, 4, 5, 4, 5, 2, 3, 2, 3, 0, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0, 1, -2, -1, -2, -1, 4, 5, 4, 5, 2, 3, 2, 3, 4, 5, 4, 5, 2, 3, 2, 3, -8, -7, -8, -7, -10, -9, -10, -9, -8, -7, -8, -7 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

See A318703 for the imaginary part of f.

See A318704 for the square of the modulus of f.

The function f defines a bijection from the nonnegative integers to the Gaussian integers.

This sequence has similarities with A316657.

LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..16383

Index entries for sequences related to binary expansion of n

Rémy Sigrist, Colored scatterplot of (a(n), A318703(n)) for n = 0..2^19-1 (where the hue is function of n)

FORMULA

a(n) = A053985(A059905(n)).

a(4 * k) = -2 * a(k) for any k >= 0.

MATHEMATICA

Array[Re[Total@ MapIndexed[#1*I^(First@ #2 - 1)*2^Floor[(First@ #2 - 1)/2] &, Reverse@ IntegerDigits[#, 2]]] &, 76, 0] (* Michael De Vlieger, Sep 02 2018 *)

PROG

(PARI) a(n) = my (b=Vecrev(binary(n))); real(sum(k=1, #b, b[k] * I^(k-1) * 2^floor((k-1)/2)))

CROSSREFS

Cf. A053985, A059905, A316657, A318703, A318704.

Sequence in context: A339455 A123724 A107016 * A226519 A066057 A060588

Adjacent sequences:  A318699 A318700 A318701 * A318703 A318704 A318705

KEYWORD

sign,base

AUTHOR

Rémy Sigrist, Sep 01 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 May 11 13:41 EDT 2021. Contains 343791 sequences. (Running on oeis4.)