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

A332252 a(n) is the imaginary part of f(n) defined by f(0) = 0 and f(n+1) = f(n) + i^A000120(n) (where i denotes the imaginary unit). Sequence A332251 gives real parts.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 08 2020

Keywords

Crossrefs

Cf. A000120, A332251 (real parts and additional comments).

Programs

  • PARI
    { z=0; for (n=0, 67, print1 (imag(z) ", "); z += I^hammingweight(n)) }

Formula

For any k >= 0:
- a(2^(4*k)) = 0,
- a(2^(4*k+1)) = (-4)^k,
- a(2^(4*k+2)) = 2*(-4)^k,
- a(2^(4*k+3)) = 2*(-4)^k.

A332383 a(n) is the X-coordinate of the n-th point of the dragon curve. Sequence A332384 gives Y-coordinates.

Original entry on oeis.org

0, 1, 1, 0, 0, -1, -1, -2, -2, -3, -3, -2, -2, -3, -3, -4, -4, -5, -5, -4, -4, -3, -3, -2, -2, -3, -3, -2, -2, -3, -3, -4, -4, -5, -5, -4, -4, -3, -3, -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, 0, 0, 1, 1, 2
Offset: 0

Views

Author

Rémy Sigrist, Feb 10 2020

Keywords

Comments

To build the curve:
- start from the origin looking to the right,
- for k = 0, 1, ...:
- move forward to the next lattice point,
- if A014577(n) = 1 then turn 90 degrees to the left
otherwise turn 90 degrees to the right.

Crossrefs

See A332251 for a similar sequence.
Cf. A014577, A332384 (Y-coordinates).

Programs

  • Mathematica
    Re[Join[{0}, Accumulate[Nest[Join[#, Reverse[I #]] &, {1}, 7]]]] (* Vladimir Reshetnikov, Apr 14 2022 *)
  • PARI
    A014577(n)=1/2*(1+(-1)^(1/2*((n+1)/2^valuation(n+1, 2)-1)))
    { z=0; d=1; for (n=0, 71, print1 (real(z) ", "); z += d; d*=if (A014577(n), +I, -I)) }

Formula

For any k >= 0:
- a(2^(4*k)) = (-4)^k,
- a(2^(4*k+1)) = (-4)^k,
- a(2^(4*k+2)) = 0,
- a(2^(4*k+3)) = -2*(-4)^k.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 29 2021

Keywords

Comments

The function f defines a bijection from the nonnegative integers to the Gaussian integers.
The function f has similarities with A065620; here the nonzero digits in base 1+i cycle through powers of i, there nonzero digits in base 2 cycle through powers of -1.
If we replace 1's in binary expansions by powers of i from left to right (rather than right to left as here), then we obtain the Lévy C curve (A332251, A332252).

Crossrefs

See A332251 for a similar sequence.

Programs

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

Formula

a(2^k) = A146559(k) for any k >= 0.

A348691 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} b_k * (i^Sum_{j = 0..k-1} b_j) * (1+i)^k (where i denotes the imaginary unit); sequence A348690 gives the real part.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 29 2021

Keywords

Comments

The function f defines a bijection from the nonnegative integers to the Gaussian integers.
The function f has similarities with A065620; here the nonzero digits in base 1+i cycle through powers of i, there nonzero digits in base 2 cycle through powers of -1.
If we replace 1's in binary expansions by powers of i from left to right (rather than right to left as here), then we obtain the Lévy C curve (A332251, A332252).

Crossrefs

See A332251, A332252 for a similar sequence.

Programs

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

Formula

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