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

A305463 Inverse permutation to A305458.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 12, 13, 14, 15, 10, 11, 18, 19, 20, 21, 28, 29, 24, 25, 26, 27, 16, 17, 30, 31, 32, 33, 124, 125, 36, 37, 38, 39, 202, 203, 132, 133, 134, 135, 130, 131, 168, 169, 170, 171, 58, 59, 84, 85, 86, 87, 76, 77, 60, 61, 62, 63
Offset: 0

Views

Author

Rémy Sigrist, Jun 01 2018

Keywords

Crossrefs

Cf. A305458.

Programs

  • PARI
    a(n) = my (v=0, k=1, r=2, p=1); while (n, my (d=n % r); if (d, my (t = lift(Mod(d, r)/Mod(k, r))); v += t * p; k *= t); n \= r; p *= r; r = nextprime(r+1)); return (v)

A305462 Fixed points of A305458.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 18, 19, 20, 21, 24, 25, 26, 27, 30, 31, 32, 33, 36, 37, 38, 39, 60, 61, 62, 63, 66, 67, 68, 69, 90, 91, 92, 93, 96, 97, 98, 99, 120, 121, 122, 123, 126, 127, 128, 129, 150, 151, 152, 153, 156, 157, 158, 159, 180
Offset: 1

Views

Author

Rémy Sigrist, Jun 01 2018

Keywords

Comments

Equivalently, these are the numbers with all digits, except possibly the leading digit, equal to zero or one in primorial base.

Examples

			The first terms, alongside their primorial base representation, are:
  n   a(n)    pbr(a(n))
  --  ----    ---------
   1     0    (0)
   2     1    (1)
   3     2    (1, 0)
   4     3    (1, 1)
   5     4    (2, 0)
   6     5    (2, 1)
   7     6    (1, 0, 0)
   8     7    (1, 0, 1)
   9     8    (1, 1, 0)
  10     9    (1, 1, 1)
  11    12    (2, 0, 0)
  12    13    (2, 0, 1)
  13    14    (2, 1, 0)
  14    15    (2, 1, 1)
  15    18    (3, 0, 0)
		

Crossrefs

Cf. A305458.

A353824 The positions of nonzero digits in the ternary expansions of n and a(n) are the same, and the k-th leftmost nonzero digit in a(n) equals modulo 3 the product of the k leftmost nonzero digits in n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 11, 12, 13, 14, 15, 17, 16, 18, 20, 19, 24, 26, 25, 21, 22, 23, 27, 28, 29, 30, 31, 32, 33, 35, 34, 36, 37, 38, 39, 40, 41, 42, 44, 43, 45, 47, 46, 51, 53, 52, 48, 49, 50, 54, 56, 55, 60, 62, 61, 57, 58, 59, 72, 74, 73, 78, 80
Offset: 0

Views

Author

Rémy Sigrist, May 08 2022

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A353825.
A number is a fixed point of this sequence iff it has at most one digit 2 in its ternary expansion, that digit 2 being its rightmost nonzero digit.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2       2          2
   3     3      10         10
   4     4      11         11
   5     5      12         12
   6     6      20         20
   7     8      21         22
   8     7      22         21
   9     9     100        100
  10    10     101        101
  11    11     102        102
  12    12     110        110
		

Crossrefs

See A305458, A353826, A353828, A353830 for similar sequences.
Cf. A353825 (inverse).

Programs

  • PARI
    a(n) = { my (d=digits(n,3), p=1); for (k=1, #d, if (d[k], d[k]=p*=d[k])); fromdigits(d%3,3) }

Formula

a(3*n) = 3*a(n).

A353826 The positions of nonzero digits in the ternary expansions of n and a(n) are the same, and the k-th rightmost nonzero digit in a(n) equals modulo 3 the product of the k rightmost nonzero digits in n.

Original entry on oeis.org

0, 1, 2, 3, 4, 8, 6, 7, 5, 9, 10, 20, 12, 13, 26, 24, 25, 14, 18, 19, 11, 21, 22, 17, 15, 16, 23, 27, 28, 56, 30, 31, 62, 60, 61, 32, 36, 37, 74, 39, 40, 80, 78, 79, 41, 72, 73, 38, 75, 76, 44, 42, 43, 77, 54, 55, 29, 57, 58, 35, 33, 34, 59, 63, 64, 47, 66, 67
Offset: 0

Views

Author

Rémy Sigrist, May 08 2022

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A353827.
A number is a fixed point of this sequence iff it has at most one digit 2 in its ternary expansion, that digit 2 being its leftmost nonzero digit.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2       2          2
   3     3      10         10
   4     4      11         11
   5     8      12         22
   6     6      20         20
   7     7      21         21
   8     5      22         12
   9     9     100        100
  10    10     101        101
  11    20     102        202
  12    12     110        110
		

Crossrefs

See A305458, A353824, A353828, A353830 for similar sequences.
Cf. A353827 (inverse).

Programs

  • PARI
    a(n) = { my (d=digits(n,3), p=1); forstep (k=#d, 1, -1, if (d[k], d[k]=p*=d[k])); fromdigits(d%3,3) }

Formula

a(3*n) = 3*a(n).
a(3*n + 1) = 3*a(n) + 1.

A353828 The positions of nonzero digits in the balanced ternary expansions of n and a(n) are the same, and the k-th leftmost nonzero digit in a(n) equals the product of the k leftmost nonzero digits in n.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 5, 8, 9, 10, 11, 12, 13, 20, 21, 22, 19, 18, 17, 16, 15, 14, 25, 24, 23, 26, 27, 28, 29, 30, 31, 34, 33, 32, 35, 36, 37, 38, 39, 40, 61, 60, 59, 62, 63, 64, 65, 66, 67, 56, 57, 58, 55, 54, 53, 52, 51, 50, 47, 48, 49, 46, 45, 44, 43, 42, 41
Offset: 0

Views

Author

Rémy Sigrist, May 08 2022

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A353829.
A number is a fixed point of this sequence iff it has at most one digit -1 in its balanced ternary expansion, that digit -1 being its rightmost nonzero digit.

Examples

			The first terms, in decimal and in balanced ternary, are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     2       1T          1T
   3     3       10          10
   4     4       11          11
   5     7      1TT         1T1
   6     6      1T0         1T0
   7     5      1T1         1TT
   8     8      10T         10T
   9     9      100         100
  10    10      101         101
  11    11      11T         11T
  12    12      110         110
		

Crossrefs

See A305458, A353824, A353826, A353830 for similar sequences.
Cf. A353829 (inverse).

Programs

  • PARI
    a(n) = {
        my (d=[], t, p=1);
        while (n, d=concat(t=[0,1,-1][1+n%3], d); n=(n-t)/3);
        for (k=1, #d, if (d[k], d[k]=p*=d[k]));
        fromdigits(d,3);
    }

Formula

a(3*n) = 3*a(n).

A353830 The positions of nonzero digits in the balanced ternary expansions of n and a(n) are the same, and the k-th rightmost nonzero digit in a(n) equals the product of the k rightmost nonzero digits in n.

Original entry on oeis.org

0, 1, -4, 3, 4, 11, -12, -11, -10, 9, 10, -13, 12, 13, -34, 33, 34, 35, -36, -35, 32, -33, -32, 29, -30, -29, -28, 27, 28, -31, 30, 31, 38, -39, -38, -37, 36, 37, -40, 39, 40, 101, -102, -101, -100, 99, 100, -103, 102, 103, -106, 105, 106, 107, -108, -107, 104
Offset: 0

Views

Author

Rémy Sigrist, May 08 2022

Keywords

Comments

This sequence can naturally be extended to negative integers; we then obtain a permutation of the integers (Z).
A number is a fixed point of this sequence iff it has no digit -1 in its balanced ternary expansion (A005836).

Examples

			The first terms, in decimal and in balanced ternary, are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2    -4       1T          TT
   3     3       10          10
   4     4       11          11
   5    11      1TT         11T
   6   -12      1T0         TT0
   7   -11      1T1         TT1
   8   -10      10T         T0T
   9     9      100         100
  10    10      101         101
  11   -13      11T         TTT
  12    12      110         110
		

Crossrefs

See A305458, A353824, A353826, A353828 for similar sequences.
Cf. A005836 (fixed points), A029858, A153775.

Programs

  • PARI
    a(n) = {
            my (d=[], t, p=1);
            while (n, d=concat(t=[0,1,-1][1+n%3], d); n=(n-t)/3);
            forstep (k=#d, 1, -1, if (d[k], d[k]=p*=d[k]));
            fromdigits(d,3);
    }

Formula

a(3*n) = 3*a(n).
a(3*n + 1) = 3*a(n) + 1.
Sum_{k = 0..n} a(n) = 0 iff n belongs to A029858.
Showing 1-6 of 6 results.