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-2 of 2 results.

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

Original entry on oeis.org

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
Offset: 0

Views

Author

Rémy Sigrist, Sep 01 2018

Keywords

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.

Crossrefs

Programs

  • 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 *)
  • PARI
    a(n) = my (b=Vecrev(binary(n))); real(sum(k=1, #b, b[k] * I^(k-1) * 2^floor((k-1)/2)))

Formula

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

A318704 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 square of the modulus of f(n).

Original entry on oeis.org

0, 1, 1, 2, 4, 1, 5, 2, 4, 5, 1, 2, 8, 5, 5, 2, 16, 25, 17, 26, 4, 9, 5, 10, 20, 29, 17, 26, 8, 13, 5, 10, 16, 17, 25, 26, 20, 17, 29, 26, 4, 5, 9, 10, 8, 5, 13, 10, 32, 41, 41, 50, 20, 25, 29, 34, 20, 29, 25, 34, 8, 13, 13, 18, 64, 49, 65, 50, 100, 81, 101
Offset: 0

Views

Author

Rémy Sigrist, Sep 01 2018

Keywords

Comments

See A318702 for the real part of f and additional comments.

Crossrefs

Cf. A318702.

Programs

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

Formula

a(n) = A318702(n)^2 + A318703(n)^2.
a(4 * k) = 4 * a(k) for any k >= 0.
Showing 1-2 of 2 results.