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.

A332412 a(n) is the real part of f(n) = Sum_{d_k > 0} 3^k * i^(d_k-1) where Sum_{k >= 0} 5^k * d_k is the base 5 representation of n and i denotes the imaginary unit. Sequence A332413 gives imaginary parts.

Original entry on oeis.org

0, 1, 0, -1, 0, 3, 4, 3, 2, 3, 0, 1, 0, -1, 0, -3, -2, -3, -4, -3, 0, 1, 0, -1, 0, 9, 10, 9, 8, 9, 12, 13, 12, 11, 12, 9, 10, 9, 8, 9, 6, 7, 6, 5, 6, 9, 10, 9, 8, 9, 0, 1, 0, -1, 0, 3, 4, 3, 2, 3, 0, 1, 0, -1, 0, -3, -2, -3, -4, -3, 0, 1, 0, -1, 0, -9, -8, -9
Offset: 0

Views

Author

Rémy Sigrist, Feb 12 2020

Keywords

Comments

The representation of {f(n)} corresponds to the cross form of the Vicsek fractal.
As a set, {f(n)} corresponds to the Gaussian integers whose real and imaginary parts have not simultaneously a nonzero digit at the same place in their balanced ternary representations.

Examples

			For n = 103:
- 103 = 4*5^2 + 3*5^0,
- so f(123) = 3^2 * i^(4-1) + 3^0 * i^(3-1) = -1 - 9*i,
- and a(n) = -1.
		

Crossrefs

See A332497 for a similar sequence.
Cf. A031219, A289813, A332413 (imaginary parts).

Programs

  • PARI
    a(n) = { my (d=Vecrev(digits(n,5))); real(sum (k=1, #d, if (d[k], 3^(k-1)*I^(d[k]-1), 0))) }

Formula

a(n) = 0 iff the n-th row of A031219 has only even terms.
a(5*n) = 3*a(n).
a(5*n+1) = 3*a(n) + 1.
a(5*n+2) = 3*a(n).
a(5*n+3) = 3*a(n) - 1.
a(5*n+4) = 3*a(n).