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

A318438 For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let h(n) = Sum_{k=0..w} b_k * (i-1)^k (where i denotes the imaginary unit); a(n) is the real part of h(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 26 2018

Keywords

Comments

See A318439 for the imaginary part of h.
See A318479 for the square of the modulus of h.
The function h corresponds to the interpretation of the binary representation of a number in base -1+i and defines a bijection from the nonnegative integers to the Gaussian integers.
The function h has nice fractal features (see scatterplot in Links section).
This sequence has similarities with A316657.

Crossrefs

Cf. A009116, A318439 (imaginary part), A318479 (norm), A340669 (negation).
Cf. A316657 (base 2+i).

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n,2))); real(sum(i=1, #d, d[i]*(I-1)^(i-1)))

Formula

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

A334492 a(n) is the "real" part of f(n) = Sum_{k>=0, d_k>0} (1+w)^(d_k-1) * (3+w)^k where Sum_{k>=0} d_k * 7^k is the base 7 representation of n and w = -1/2 + sqrt(-3)/2 is a primitive cube root of unity; sequence A334493 gives "w" parts.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 03 2020

Keywords

Comments

For any Eisenstein integer z = u + v*w (where u and v are integers), we call u the "real" part of z and v the "w" part of z.
This sequence has connections with A316657; here we work with Eisenstein integers, there with Gaussian integers.
It appears that f defines a bijection from the nonnegative integers to the Eisenstein integers.

Examples

			The following diagram depicts f(n) for n = 0..13:
            "w" axis
                \
           .     .     .     .     .     .     .     .
                  \              10     9
                   \
        .     .     .     .     .     .     .     .
                   3 \   2    11     7     8
                      \
           ._____._____._____._____._____._____._____. "real" axis
                4     0 \   1    12    13
                         \
        .     .     .     .     .     .     .     .
                   5     6 \
- f(9) = 4 + 2*w, hence a(9) = 4.
		

Crossrefs

Cf. A307013 (equivalent coordinate for a counterclockwise spiral), A316657, A334493.

Programs

  • PARI
    See Links section.

A316658 For any n >= 0 with base-5 expansion Sum_{k=0..w} d_k * 5^k, let f(n) = Sum_{k=0..w} [d_k > 0] * (2 + i)^k * i^(d_k - 1) (where [] is an Iverson bracket and i denotes the imaginary unit); a(n) equals the imaginary part of f(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 09 2018

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{d, z}, d = IntegerDigits[n, 5] // Reverse; z = Sum[ If[d[[i]]>0, (2+I)^(i-1)*I^(d[[i]]-1), 0], {i, 1, Length[d]}]; Im[z]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 06 2021, after PARI code *)
  • PARI
    a(n) = my (d=Vecrev(digits(n, 5)), z=sum(i=1, #d, if (d[i], (2+I)^(i-1) * I^(d[i]-1), 0))); imag(z)

Formula

a(5^n) = A099456(n-1) for any n > 0.

A290884 Let S be the sequence generated by these rules: 0 is in S, and if z is in S, then z * (1+i) and (z-1) * (1+i) + 1 are in S (where i denotes the imaginary unit), and duplicates are deleted as they occur; a(n) = the real part of the n-th term of S.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 13 2017

Keywords

Comments

See A290885 for the imaginary part of the n-th term of S.
See A290886 for the square of the norm of the n-th term of S.
This sequence is a variant of A290536.
The representation of the first terms of S in the complex plane has nice fractal features, and looks like a Dragon curve (see also Links section).
The building of this sequence is close to that of the Twindragon (see Wikipedia link).
The sequence S' built with the same rules but with the initial term S'(1) = 1 seems to be the complement of S; the set of elements of S is the image of the set of elements of S' with respect to the symmetry z -> 1 - z.
From Rémy Sigrist, Jul 10 2018: (Start)
For any n >= 0 with binary expansion Sum_{k=0..h} b_k * 2^k, let g(n) = Sum_{k=0..h} b_k * (1+i)^k (where i denotes the imaginary unit).
Apparently, g(n) = i * a(n+1) - A290885(n+1) for any n >= 0.
The function g has similarities with the function f defined in A316657.
(End)

Examples

			Let f be the function z -> z * (1+i), and g the function z -> (z-1) * (1+i) + 1.
S(1) = 0 by definition; so a(1) = 0.
f(S(1)) = 0 has already occurred.
g(S(1)) = -i has not yet occurred; so S(2) = -i and a(2) = 0.
f(S(2)) = 1 - i has not yet occurred; so S(3) = 1 - i and a(3) = 1.
g(S(2)) = 1 - 2*i has not yet occurred; so S(4) = 1 - 2*i and a(4) = 1.
f(S(3)) = 2 has not yet occurred; so S(5) = 2 and a(5) = 2.
g(S(3)) = 2 - i has not yet occurred; so S(6) = 2 - i and a(6) = 2.
f(S(4)) = 3 - i has not yet occurred; so S(7) = 3 - i and a(7) = 3.
g(S(4)) = 3 - 2*i has not yet occurred; so S(8) = 3 - 2*i and a(8) = 3.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • PARI
    a(n) = imag(subst(Pol(binary(n-1)),'x,I+1)); \\ Kevin Ryde, Apr 04 2020

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.

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.

A318722 Let f(0) = 0 and f(t*4^k + u) = i^t * ((1+i) * 2^k - f(u)) for any t in {1, 2, 3} and k >= 0 and u such that 0 <= u < 4^k (i denoting the imaginary unit); for any n >= 0, let g(n) = (f(A042968(n)) - 1 - i) / 2; a(n) is the real part of g(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Sep 02 2018

Keywords

Comments

See A318723 for the imaginary part of g.
See A318724 for the square of the modulus of g.
This sequence can be computed by considering the base 4 representation of A042968, hence the keyword base.
The function g runs uniquely through the set of Gaussian integers z such that Re(z) < 0 or Im(z) < 0.
The function g is related to the numbering of the cells in a Chair tiling (see representation of g(n) in Links section).
This sequence has similarities with A316657.

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(1+n+n\3,4)), z=0); for (k=1, #d, if (d[k], z = I^d[k] * (-z + (1+I) * 2^(k-1)))); real((z-1-I)/2)

Formula

a(n) = A318723(n) iff the base 4 representation of A042968(n) contains only 0's and 2's.
If A048647(A042968(m)) = A042968(n), then a(m) = A318723(n) and A318723(m) = a(n).

A348652 For any nonnegative number n with base-13 expansion Sum_{k >= 0} d_k*13^k, a(n) is the real part of Sum_{k >= 0} g(d_k)*(3+2*i)^k where g(0) = 0, and g(1+u+3*v) = (1+u*i)*i^v for any u = 0..2 and v = 0..3 (where i denotes the imaginary unit); see A348653 for the imaginary part.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 27 2021

Keywords

Comments

The function f defines a bijection from the nonnegative integers to the Gaussian integers.
The following diagram depicts g(d) for d = 0..12:
|
| +
| 3
|
+ + + +
6 5 |4 2
|
--------+----+----+-------
7 |0 1
|
+ + + +
8 |10 11 12
|
+ |
9 |

Crossrefs

See A316657 for a similar sequence.

Programs

  • PARI
    g(d) = { if (d==0, 0, (1+I*((d-1)%3))*I^((d-1)\3)) }
    a(n) = real(subst(Pol([g(d)|d<-digits(n, 13)]), 'x, 3+2*I))

Formula

a(13^k) = A121622(k).

A316707 For any n >= 0 with base-5 expansion Sum_{k=0..w} d_k * 5^k, let f(n) = Sum_{k=0..w} [d_k > 0] * (2 + i)^k * i^(d_k - 1) (where [] is an Iverson bracket and i denotes the imaginary unit); a(n) equals the square of the modulus of f(n).

Original entry on oeis.org

0, 1, 1, 1, 1, 5, 10, 8, 2, 4, 5, 4, 10, 8, 2, 5, 2, 4, 10, 8, 5, 8, 2, 4, 10, 25, 32, 34, 20, 18, 50, 61, 61, 41, 41, 40, 45, 53, 37, 29, 10, 13, 17, 9, 5, 20, 29, 25, 13, 17, 25, 18, 32, 34, 20, 20, 17, 29, 25, 13, 50, 41, 61, 61, 41, 40, 29, 45, 53, 37, 10
Offset: 0

Views

Author

Rémy Sigrist, Jul 11 2018

Keywords

Comments

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

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n, 5)), z=sum(i=1, #d, if (d[i], (2+I)^(i-1) * I^(d[i]-1), 0))); real(z)^2 + imag(z)^2

Formula

a(n) = A316657(n)^2 + A316658(n)^2.
a(5 * n) = 5 * a(n) for any n >= 0.
a(5^k) = 5^k for any k >= 0.

A348354 The base-5 expansion of a(n) is obtained by replacing 1's, 2's, 3's and 4's by 3's, 4's, 1's and 2's, respectively, in the base-5 expansion of n.

Original entry on oeis.org

0, 3, 4, 1, 2, 15, 18, 19, 16, 17, 20, 23, 24, 21, 22, 5, 8, 9, 6, 7, 10, 13, 14, 11, 12, 75, 78, 79, 76, 77, 90, 93, 94, 91, 92, 95, 98, 99, 96, 97, 80, 83, 84, 81, 82, 85, 88, 89, 86, 87, 100, 103, 104, 101, 102, 115, 118, 119, 116, 117, 120, 123, 124, 121
Offset: 0

Views

Author

Rémy Sigrist, Oct 14 2021

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
It is possible to build a similar sequence for any fixed base b > 1 and any permutation p of {1, ..., b-1}.
This sequence is interesting as it satisfies f(a(n)) = -f(n), where f(n) = (A316657(n), A316658(n)).

Examples

			The first terms, in decimal and in base 5, are:
  n   a(n)  q(n)  q(a(n))
  --  ----  ----  -------
   0     0     0        0
   1     3     1        3
   2     4     2        4
   3     1     3        1
   4     2     4        2
   5    15    10       30
   6    18    11       33
   7    19    12       34
   8    16    13       31
   9    17    14       32
  10    20    20       40
		

Crossrefs

See A004488, A048647 and A348355 for similar sequences.

Programs

  • Mathematica
    a[n_] := With[{d = {0, 3, 4, 1, 2}}, FromDigits[d[[IntegerDigits[n, 5] + 1]], 5]]; Array[a, 64, 0] (* Amiram Eldar, Oct 16 2021 *)
  • PARI
    a(n, p=[3,4,1,2]) = fromdigits(apply(d -> if (d, p[d], 0), digits(n, #p+1)), #p+1)

Formula

A316657(n) + A316657(a(n)) = 0.
A316658(n) + A316658(a(n)) = 0.
Showing 1-10 of 10 results.