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.

A318705 For any n >= 0 with base-9 representation Sum_{k=0..w} d_k * 9^k, let g(n) = Sum_{k=0..w} s(d_k) * 3^k (where s(0) = 0, s(1+2*j) = i^j and s(2+2*j) = i^j * (1+i) for any j > 0, and i denotes the imaginary unit); a(n) is the real part of g(n).

Original entry on oeis.org

0, 1, 1, 0, -1, -1, -1, 0, 1, 3, 4, 4, 3, 2, 2, 2, 3, 4, 3, 4, 4, 3, 2, 2, 2, 3, 4, 0, 1, 1, 0, -1, -1, -1, 0, 1, -3, -2, -2, -3, -4, -4, -4, -3, -2, -3, -2, -2, -3, -4, -4, -4, -3, -2, -3, -2, -2, -3, -4, -4, -4, -3, -2, 0, 1, 1, 0, -1, -1, -1, 0, 1, 3, 4, 4
Offset: 0

Views

Author

Rémy Sigrist, Sep 01 2018

Keywords

Comments

See A318706 for the imaginary part of g.
See A318707 for the square of the modulus of g.
The following diagrams shows s(k) for k = 0..8 in the complex plane:
|
|
s(4) s(3) s(2)
|
---s(5)--s(0)--s(1)---
|
s(6) s(7) s(8)
|
|
The function g defines a bijection from the nonnegative integers to the Gaussian integers.
This sequence has similarities with A316657.

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n, 9))); real(sum(k=1, #d, if (d[k], 3^(k-1)*I^floor((d[k]-1)/2)*(1+I)^((d[k]-1)%2), 0)))

Formula

a(9 * k) = 3 * a(k) for any k >= 0.

A318707 For any n >= 0 with base-9 representation Sum_{k=0..w} d_k * 9^k, let g(n) = Sum_{k=0..w} s(d_k) * 3^k (where s(0) = 0, s(1+2*j) = i^j and s(2+2*j) = i^j * (1+i) for any j > 0, and i denotes the imaginary unit); a(n) is the square of the modulus of g(n).

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 1, 2, 9, 16, 17, 10, 5, 4, 5, 10, 17, 18, 25, 32, 25, 20, 13, 8, 13, 20, 9, 10, 17, 16, 17, 10, 5, 4, 5, 18, 13, 20, 25, 32, 25, 20, 13, 8, 9, 4, 5, 10, 17, 16, 17, 10, 5, 18, 13, 8, 13, 20, 25, 32, 25, 20, 9, 10, 5, 4, 5, 10, 17, 16, 17
Offset: 0

Views

Author

Rémy Sigrist, Sep 01 2018

Keywords

Comments

See A318705 for the real part of g and additional comments.

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n, 9))); norm(sum(k=1, #d, if (d[k], 3^(k-1)*I^floor((d[k]-1)/2)*(1+I)^((d[k]-1)%2), 0)))

Formula

a(n) = A318705(n)^2 + A318706(n)^2.
a(9 * k) = 9 * a(k) for any k >= 0.
Showing 1-2 of 2 results.