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.

A343228 A binary encoding of the digits "+1" in balanced ternary representation of n.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 5, 4, 4, 5, 6, 6, 7, 8, 8, 9, 8, 8, 9, 10, 10, 11, 8, 8, 9, 8, 8, 9, 10, 10, 11, 12, 12, 13, 12, 12, 13, 14, 14, 15, 16, 16, 17, 16, 16, 17, 18, 18, 19, 16, 16, 17, 16, 16, 17, 18, 18, 19, 20, 20, 21, 20, 20, 21, 22, 22, 23, 16, 16, 17, 16
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the digits "+1" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = A343229(n) for any n >= 0.

Examples

			The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      1T         10
   3     2      10         10
   4     3      11         11
   5     4     1TT        100
   6     4     1T0        100
   7     5     1T1        101
   8     4     10T        100
   9     4     100        100
  10     5     101        101
  11     6     11T        110
  12     6     110        110
  13     7     111        111
  14     8    1TTT       1000
  15     8    1TT0       1000
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==+1, v+=b); n=(n-t)\3; b*=2); v }

Formula

a(n) = A289831(A060372(n)).

A343229 A binary encoding of the digits "-1" in balanced ternary representation of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 2, 2, 1, 0, 0, 1, 0, 0, 7, 6, 6, 5, 4, 4, 5, 4, 4, 3, 2, 2, 1, 0, 0, 1, 0, 0, 3, 2, 2, 1, 0, 0, 1, 0, 0, 15, 14, 14, 13, 12, 12, 13, 12, 12, 11, 10, 10, 9, 8, 8, 9, 8, 8, 11, 10, 10, 9, 8, 8, 9, 8, 8, 7, 6, 6, 5, 4, 4, 5, 4, 4, 3, 2, 2, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the digits "-1" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = A343228(n) for any n >= 0.

Examples

			The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     1      1T          1
   3     0      10          0
   4     0      11          0
   5     3     1TT         11
   6     2     1T0         10
   7     2     1T1         10
   8     1     10T          1
   9     0     100          0
  10     0     101          0
  11     1     11T          1
  12     0     110          0
  13     0     111          0
  14     7    1TTT        111
  15     6    1TT0        110
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==-1, v+=b); n=(n-t)\3; b*=2); v }

Formula

a(n) = A289831(A060373(n)).

A368225 Irregular table of nonnegative integers read by rows: the 1's in the binary expansion of n exactly match the nonzero digits in the balanced ternary expansions of the terms in the n-th row.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 18 2023

Keywords

Comments

As a flat sequence, this is a permutation of the nonnegative integers with inverse A368226 and infinitely many fixed points (see Formula section).
Row 0 has one term, and for n > 0, row n has A048896(n-1) terms.
For any n >= 0, row n ends with A005836(n+1).

Examples

			Table T(n, k) begins:
    0;
    1;
    3;
    2, 4;
    9;
    8, 10;
    6, 12;
    5, 7, 11, 13;
    27;
    26, 28;
    24, 30;
    23, 25, 29, 31;
    18, 36;
    17, 19, 35, 37;
    15, 21, 33, 39;
    14, 16, 20, 22, 32, 34, 38, 40;
    81;
    ...
		

Crossrefs

See A368229 and A368239 for similar sequences.

Programs

  • PARI
    row(n) = { my (r = [sign(n)], b = binary(n)); for (k = 2, #b, r = [3*v+b[k]|v<-r]; if (b[k], r = concat(r, [v-2|v<-r]););); Set(r); }

Formula

A343231(T(n, k)) = n.
a(m) = m for any m in A003462.

A343230 A binary encoding of the digits "0" in balanced ternary representation of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 0, 1, 0, 2, 3, 2, 0, 1, 0, 4, 5, 4, 6, 7, 6, 4, 5, 4, 0, 1, 0, 2, 3, 2, 0, 1, 0, 8, 9, 8, 10, 11, 10, 8, 9, 8, 12, 13, 12, 14, 15, 14, 12
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the nonleading digits "0" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = a(n) for any n >= 0.

Examples

			The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     0      1T          0
   3     1      10          1
   4     0      11          0
   5     0     1TT          0
   6     1     1T0          1
   7     0     1T1          0
   8     2     10T         10
   9     3     100         11
  10     2     101         10
  11     0     11T          0
  12     1     110          1
  13     0     111          0
  14     0    1TTT          0
  15     1    1TT0          1
		

Crossrefs

Cf. A059095, A140267, A291770, A343228, A343229, A343231, A147991 (indices of 0's).

Programs

  • PARI
    a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==0, v+=b); n=(n-t)\3; b*=2); v }

A343317 a(n) is the least k >= 0 such that A343316(n, k) = n.

Original entry on oeis.org

0, 1, 4, 2, 4, 13, 11, 13, 7, 5, 7, 13, 11, 13, 40, 38, 40, 34, 32, 34, 40, 38, 40, 22, 20, 22, 16, 14, 16, 22, 20, 22, 40, 38, 40, 34, 32, 34, 40, 38, 40, 121, 119, 121, 115, 113, 115, 121, 119, 121, 103, 101, 103, 97, 95, 97, 103, 101, 103, 121, 119, 121
Offset: 0

Views

Author

Rémy Sigrist, Apr 11 2021

Keywords

Comments

To compute a(n): in the balanced ternary representation of n, replace each nonzero digit by "+1" and each nonleading zero by "-1".

Examples

			The first terms, alongside their balanced ternary representation (with "T" instead of digits "-1"), are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     4       1T          11
   3     2       10          1T
   4     4       11          11
   5    13      1TT         111
   6    11      1T0         11T
   7    13      1T1         111
   8     7      10T         1T1
   9     5      100         1TT
  10     7      101         1T1
  11    13      11T         111
  12    11      110         11T
  13    13      111         111
  14    40     1TTT        1111
  15    38     1TT0        111T
		

Crossrefs

Programs

  • PARI
    a(n) = if (n==0, 0, my (d=centerlift(Mod(n, 3))); if (d, +1, -1) + 3*a((n-d)\3))
Showing 1-5 of 5 results.