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

A371257 Irregular triangle T(n, k), n >= 0, k = 1..2^A005811(n), read by rows; the n-th row lists the numbers m such that A371256(m) = n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

The n-th row has 2^A005811(n) terms.
As a flat sequence, this is a permutation of the nonnegative integers, with inverse A371258.

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  --------------------------------------------------------------
   0  0
   1  1, 2
   2  3, 5, 6, 7
   3  4, 8
   4  9, 17, 18, 22
   5  10, 11, 15, 16, 19, 20, 21, 23
   6  12, 14, 24, 25
   7  13, 26
   8  27, 53, 54, 67
   9  28, 29, 51, 52, 55, 56, 66, 68
  10  30, 32, 33, 34, 46, 47, 48, 50, 57, 59, 60, 61, 64, 65, 69, 70
  11  31, 35, 45, 49, 58, 62, 63, 71
  12  36, 44, 72, 76
  13  37, 38, 42, 43, 73, 74, 75, 77
  14  39, 41, 78, 79
  15  40, 80
.
Triangle T(n, k) begins, in ternary, with row indexes in binary:
  bin(n)  n-th row in ternary
  ------  ----------------------------------------------
       0  0
       1  1, 2
      10  10, 12, 20, 21
      11  11, 22
     100  100, 122, 200, 211
     101  101, 102, 120, 121, 201, 202, 210, 212
     110  110, 112, 220, 221
     111  111, 222
    1000  1000, 1222, 2000, 2111
    1001  1001, 1002, 1220, 1221, 2001, 2002, 2110, 2112
		

Crossrefs

See A371265 for a similar sequence.

Programs

  • PARI
    \\ See Links section.

A371263 The run lengths transform of the balanced ternary expansion of n corresponds to the run lengths transform of the binary expansion of a(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

For any v > 0, the value v appears A225081(v-1) times in the sequence.

Examples

			The first terms, alongside the balanced ternary expansion of n and the binary expansion of a(n), are:
  n   a(n)  bter(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     5      1T0        101
   7     5      1T1        101
   8     5      10T        101
   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     9     1TT0       1001
		

Crossrefs

See A371256 for a similar sequence.

Programs

  • PARI
    a(n) = { my (r = [], d, l, v = 0); while (n, d = centerlift(Mod(n, 3)); l = 0; while (centerlift(Mod(n, 3))==d, n = (n-d)/3; l++;); r = concat(l, r);); for (k = 1, #r, v = (v+k%2)*2^r[k]-k%2); v }

Formula

abs(a(n+1) - a(n)) <= 1.

A371261 Lexicographically latest sequence of distinct nonnegative integers such that the run lengths transforms of the ternary expansions of n and of a(n) are the same.

Original entry on oeis.org

0, 2, 1, 7, 8, 6, 5, 3, 4, 22, 23, 21, 25, 26, 24, 20, 19, 18, 17, 16, 15, 11, 9, 10, 14, 12, 13, 67, 68, 66, 70, 71, 69, 65, 64, 63, 76, 77, 75, 79, 80, 78, 74, 73, 72, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 35, 34, 33, 29, 27
Offset: 0

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			The first terms, in decimal and in base 3, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     2       1          2
   2     1       2          1
   3     7      10         21
   4     8      11         22
   5     6      12         20
   6     5      20         12
   7     3      21         10
   8     4      22         11
   9    22     100        211
  10    23     101        212
  11    21     102        210
  12    25     110        221
  13    26     111        222
  14    24     112        220
  15    20     120        202
		

Crossrefs

See A371267 for a similar sequence.

Programs

  • PARI
    \\ See Links section.

Formula

A371256(a(n)) = A371256(n).
a(A371257(n, k)) = A371257(n, 2^A005811(n) + 1 - k) for any n >= 0 and k in 1..2^A005811(n).

A371268 If the ternary expansion of n starts with a 1, replace 1's by 2's, 2's by 0's, 0's by 1's, if it starts with a 2, replace 2's by 1's, 1's by 0's, 0's by 2's.

Original entry on oeis.org

0, 2, 1, 7, 8, 6, 5, 3, 4, 22, 23, 21, 25, 26, 24, 19, 20, 18, 17, 15, 16, 11, 9, 10, 14, 12, 13, 67, 68, 66, 70, 71, 69, 64, 65, 63, 76, 77, 75, 79, 80, 78, 73, 74, 72, 58, 59, 57, 61, 62, 60, 55, 56, 54, 53, 51, 52, 47, 45, 46, 50, 48, 49, 35, 33, 34, 29, 27
Offset: 0

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			The first terms, in decimal and in base 3, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     2       1          2
   2     1       2          1
   3     7      10         21
   4     8      11         22
   5     6      12         20
   6     5      20         12
   7     3      21         10
   8     4      22         11
   9    22     100        211
  10    23     101        212
  11    21     102        210
  12    25     110        221
  13    26     111        222
  14    24     112        220
  15    19     120        201
		

Crossrefs

See A004488 and A361945 for similar sequences.

Programs

  • PARI
    a(n) = { my (d = digits(n, 3)); if (#d, d = if (d[1]==1, apply(v -> [1, 2, 0][1+v], d), apply(v -> [2, 0, 1][1+v], d));); fromdigits(d, 3); }

Formula

A371256(a(n)) = A371256(n).
Showing 1-4 of 4 results.