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.

A343231 A binary encoding of the nonzero digits in balanced ternary representation of n.

Original entry on oeis.org

0, 1, 3, 2, 3, 7, 6, 7, 5, 4, 5, 7, 6, 7, 15, 14, 15, 13, 12, 13, 15, 14, 15, 11, 10, 11, 9, 8, 9, 11, 10, 11, 15, 14, 15, 13, 12, 13, 15, 14, 15, 31, 30, 31, 29, 28, 29, 31, 30, 31, 27, 26, 27, 25, 24, 25, 27, 26, 27, 31, 30, 31, 29, 28, 29, 31, 30, 31, 23
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the nonzero digits 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     1       1          1
   2     3      1T         11
   3     2      10         10
   4     3      11         11
   5     7     1TT        111
   6     6     1T0        110
   7     7     1T1        111
   8     5     10T        101
   9     4     100        100
  10     5     101        101
  11     7     11T        111
  12     6     110        110
  13     7     111        111
  14    15    1TTT       1111
  15    14    1TT0       1110
		

Crossrefs

Programs

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

Formula

a(n) = A343228(n) + A343229(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)).

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 }

A368239 Irregular table of nonnegative integers T(n, k), n >= 0, k = 1..A080100(n), read by rows; the 1's in the binary expansion of n exactly match the 1's in the balanced ternary expansions of the terms in the n-th row.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 7, 10, 11, 12, 13, 14, 15, 17, 18, 23, 24, 26, 27, 16, 19, 25, 28, 20, 21, 29, 30, 22, 31, 32, 33, 35, 36, 34, 37, 38, 39, 40, 41, 42, 44, 45, 50, 51, 53, 54, 68, 69, 71, 72, 77, 78, 80, 81, 43, 46, 52, 55, 70, 73, 79, 82, 47, 48, 56, 57, 74, 75, 83, 84
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 A368240.

Examples

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

Crossrefs

See A368225 for a similar sequence.

Programs

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

Formula

T(n, 1) = A147991(n) for any n > 0.
T(n, A080100(n)) = A005836(n + 1).
A343228(T(n, k)) = n.

A343312 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the digits "-1" in the balanced ternary representation of a(n) correspond to digits "+1" in that of a(n+1).

Original entry on oeis.org

0, 1, 2, 4, 3, 5, 13, 6, 11, 7, 12, 8, 10, 9, 14, 40, 15, 38, 16, 39, 17, 34, 20, 37, 18, 32, 22, 33, 21, 35, 19, 36, 23, 31, 24, 29, 25, 30, 26, 28, 27, 41, 121, 42, 119, 43, 120, 44, 115, 47, 118, 45, 113, 49, 114, 48, 116, 46, 117, 50, 103, 59, 112, 51, 101
Offset: 0

Views

Author

Rémy Sigrist, Apr 11 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers (with inverse A343313):
- we can always extend the sequence with a member of A003462 sufficiently large,
- so the sequence is infinite and unbounded,
- once we have a k-digit number and before introducing a number with more than k digits, we must use A003462(k),
- so we have infinitely many terms of A003462 in this sequence,
- for any m with k digits, we have infinitely many terms of A003462 > m in the sequence, each of these terms can be followed by m, so m must eventually appear.
Apparently:
- the sequence preserves the number of digits in balanced ternary representation (A134021),
- fixed points correspond to 0 and A007051.

Examples

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

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A343229(a(n)) AND A343228(a(n+1)) = A343228(a(n+1)) (where AND denotes the bitwise AND operator).
Showing 1-5 of 5 results.