cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A348761 For any nonnegative number n with binary expansion Sum_{k >= 0} b_k * 2^k, a(n) is the imaginary part of f(n) = Sum_{k >= 0} ((-1)^Sum_{j = 0..k-1} b_j) * (1+i)^k (where i denotes the imaginary unit); sequence A348760 gives the real part.

Original entry on oeis.org

0, 0, 1, -1, 2, -2, -1, 1, 2, -2, -1, 1, 0, 0, 1, -1, 0, 0, 1, -1, 2, -2, -1, 1, 2, -2, -1, 1, 0, 0, 1, -1, -4, 4, 5, -5, 6, -6, -5, 5, 6, -6, -5, 5, -4, 4, 5, -5, 4, -4, -3, 3, -2, 2, 3, -3, -2, 2, 3, -3, 4, -4, -3, 3, -8, 8, 9, -9, 10, -10, -9, 9, 10, -10
Offset: 0

Views

Author

Rémy Sigrist, Oct 31 2021

Keywords

Comments

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

Crossrefs

See A348691 for a similar sequence.

Programs

  • PARI
    a(n) = { my (v=0, k, o=-1); while (n, n-=2^k=valuation(n,2); v+=(1+I)^k * (-1)^o++); imag(v) }

Formula

a(2^k) = A009545(k) for any k >= 0.
Showing 1-1 of 1 results.