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

A316657 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 real part of f(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 09 2018

Keywords

Comments

See A316658 for the imaginary part of f.
See A316707 for the square of the modulus of f.
The function f has nice fractal features (see scatterplot in Links section).
It appears that f defines a bijection from the nonnegative integers to the Gaussian integers.

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]}]; Re[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))); real(z)

Formula

a(5^n) = A139011(n) for any n >= 0.
a(3 * 5^n) = -A139011(n) for any n >= 0.

A334493 a(n) is the "w" 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 A334492 gives "real" parts.

Original entry on oeis.org

0, 0, 1, 1, 0, -1, -1, 1, 1, 2, 2, 1, 0, 0, 3, 3, 4, 4, 3, 2, 2, 2, 2, 3, 3, 2, 1, 1, -1, -1, 0, 0, -1, -2, -2, -3, -3, -2, -2, -3, -4, -4, -2, -2, -1, -1, -2, -3, -3, 5, 5, 6, 6, 5, 4, 4, 6, 6, 7, 7, 6, 5, 5, 8, 8, 9, 9, 8, 7, 7, 7, 7, 8, 8, 7, 6, 6, 4, 4, 5
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 A316658; 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) = 2.
		

Crossrefs

Cf. A307012 (equivalent coordinate for a counterclockwise spiral), A316658, A334492.

Programs

  • PARI
    See Links section.

A348653 For any nonnegative number n with base-13 expansion Sum_{k >= 0} d_k*13^k, a(n) is the imaginary 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 A348652 for the real part.

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 1, 0, -1, -2, -1, -1, -1, 2, 2, 3, 4, 3, 3, 3, 2, 1, 0, 1, 1, 1, 5, 5, 6, 7, 6, 6, 6, 5, 4, 3, 4, 4, 4, 8, 8, 9, 10, 9, 9, 9, 8, 7, 6, 7, 7, 7, 3, 3, 4, 5, 4, 4, 4, 3, 2, 1, 2, 2, 2, 1, 1, 2, 3, 2, 2, 2, 1, 0, -1, 0, 0, 0, -1, -1, 0, 1, 0, 0
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 A316658 for a similar sequence.

Programs

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

Formula

abs(a(13^k)) = A188982(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-5 of 5 results.