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.

A332413 a(n) is the imaginary 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 A332412 gives real parts.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 12 2020

Keywords

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

Crossrefs

Cf. A031219, A289814, A332412 (real parts and additional comments).

Programs

  • PARI
    a(n) = { my (d=Vecrev(digits(n,5))); imag(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 neither 2's nor 4's.
a(5*n) = 3*a(n).
a(5*n+1) = 3*a(n).
a(5*n+2) = 3*a(n) + 1.
a(5*n+3) = 3*a(n).
a(5*n+4) = 3*a(n) - 1.

A332497 a(n) = x(w+1) where x(0) = 0 and x(k+1) = 2^(k+1)-1-x(k) (resp. x(k)) when d_k = 1 (resp. d_k <> 1) and Sum_{k=0..w} d_k*3^k is the ternary representation of n. Sequence A332498 gives corresponding y's.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 14 2020

Keywords

Comments

The representation of {(a(n), A332498(n))} is related to the T-square fractal (see illustration in Links section).
We can iteratively build the set {(a(n), A332498(n))} as follows:
- start with X_0 = {(0, 0)},
- for k = 0, 1, ..., X_{k+1} is obtained by adjoining to X_k:
- an horizontally mirrored copy of X_k to the right,
- and a vertically mirrored copy of X_k on the top,
- this corresponds to the following substitution:
.---.
.---. | V |
| X | --> .---.---.
.---. | X | H |
.---.---.

Examples

			For n = 42:
- the ternary representation of 42 is "1120",
- x(0) = 0,
- x(1) = x(0) = 0 (as d_0 = 0 <> 1),
- x(2) = x(1) = 0 (as d_1 = 2 <> 1),
- x(3) = 2^3-1 - x(2) = 7 (as d_2 = 1),
- x(4) = 2^4-1 - x(3) = 8 (as d_3 = 1),
- hence a(42) = 8.
		

Crossrefs

See A332412 for a similar sequence.
Cf. A005823, A332498 (corresponding y's).

Programs

  • PARI
    a(n) = { my (x=0, k=1); while (n, if (n%3==1, x=2^k-1-x); n\=3; k++); x }

Formula

a(n) = 0 iff n belongs to A005823.
Showing 1-2 of 2 results.