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.

A341054 For any number n with balanced ternary expansion (d_1, ..., d_k), the balanced ternary expansion of a(n), say (t_1, ..., t_k), satisfies t_m = d_1 + ... + d_m mod 3 for m = 1..k.

Original entry on oeis.org

0, 1, 3, 4, 2, 8, 9, 10, 12, 13, 11, 7, 5, 6, 25, 23, 24, 26, 27, 28, 30, 31, 29, 35, 36, 37, 39, 40, 38, 34, 32, 33, 21, 22, 20, 16, 14, 15, 17, 18, 19, 75, 76, 74, 70, 68, 69, 71, 72, 73, 79, 77, 78, 80, 81, 82, 84, 85, 83, 89, 90, 91, 93, 94, 92, 88, 86, 87
Offset: 0

Views

Author

Rémy Sigrist, Apr 25 2021

Keywords

Comments

This sequence is similar to A006068.
This sequence is a permutation of the nonnegative integers with inverse A341055.

Examples

			The first terms, alongside their balanced ternary expansion (with T's standing for -1's), are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     3       1T          10
   3     4       10          11
   4     2       11          1T
   5     8      1TT         10T
   6     9      1T0         100
   7    10      1T1         101
   8    12      10T         110
   9    13      100         111
  10    11      101         11T
  11     7      11T         1T1
  12     5      110         1TT
  13     6      111         1T0
  14    25     1TTT        10T1
  15    23     1TT0        10TT
  16    24     1TT1        10T0
		

Crossrefs

Cf. A006068, A059095, A341055 (inverse).

Programs

  • PARI
    a(n) = { my (d=[], s=Mod(0, 3)); while (n, my (t=centerlift(Mod(n, 3))); n=(n-t)\3; d=concat(t, d)); for (k=1, #d, d[k] = centerlift(s+=d[k])); fromdigits(d, 3) }

A343766 Lexicographically earliest sequence of distinct integers such that a(0) = 0 and the balanced ternary expansions of two consecutive terms differ by a single digit, as far to the right as possible.

Original entry on oeis.org

0, -1, 1, -2, -4, -3, 3, 2, 4, -5, -7, -6, -12, -13, -11, -8, -10, -9, 9, 8, 10, 7, 5, 6, 12, 11, 13, -14, -16, -15, -21, -22, -20, -17, -19, -18, -36, -37, -35, -38, -40, -39, -33, -34, -32, -23, -25, -24, -30, -31, -29, -26, -28, -27, 27, 26, 28, 25, 23, 24
Offset: 0

Views

Author

Rémy Sigrist, Apr 28 2021

Keywords

Comments

This sequence has similarities with A003188 and with A341055.
A007949 gives the positions of the digit that is altered from one term to the other.
To compute a(n):
- consider the ternary representation of A128173(n),
- replace 1's by -1's and 2's by 1's,
- convert back to decimal.

Examples

			The first terms, alongside their balanced ternary expansion (with T's denoting -1's), are:
  n   a(n)  bter(a(n))
  --  ----  ----------
   0     0           0
   1    -1           T
   2     1           1
   3    -2          T1
   4    -4          TT
   5    -3          T0
   6     3          10
   7     2          1T
   8     4          11
   9    -5         T11
  10    -7         T1T
  11    -6         T10
  12   -12         TT0
  13   -13         TTT
  14   -11         TT1
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = -A117966(A128173(n)).
Sum_{k=0..n-1} sign(a(k)) = -A081134(n).
Sum_{k=0..n} a(k) = 0 iff n belongs to A024023.
Showing 1-2 of 2 results.