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.

A371258 Inverse permutation to A371257.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Examples

			A371257(42) = 34, so a(34) = 42.
		

Crossrefs

Cf. A371257.

Programs

  • PARI
    \\ See Links section.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

For any v >= 0, the value v appears 2^A005811(v) times in the sequence.

Examples

			The first terms, alongside the ternary expansion of n and the binary expansion of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1       2          1
   3     2      10         10
   4     3      11         11
   5     2      12         10
   6     2      20         10
   7     2      21         10
   8     3      22         11
   9     4     100        100
  10     5     101        101
  11     5     102        101
  12     6     110        110
  13     7     111        111
  14     6     112        110
  15     5     120        101
		

Crossrefs

See A371263 for a similar sequence.

Programs

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

Formula

a(A005823(n)) = n - 1.
a(A005836(n)) = n - 1.
a(A004488(n)) = a(n).
abs(a(n+1) - a(n)) <= 1.

A371265 Irregular triangle T(n, k), n >= 0, read by rows; the n-th row lists the numbers m such that A371263(m) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 6, 7, 8, 10, 11, 12, 13, 14, 27, 15, 16, 26, 28, 17, 19, 20, 21, 24, 25, 29, 30, 18, 22, 23, 31, 32, 36, 33, 34, 35, 37, 38, 39, 40, 41, 81, 42, 43, 80, 82, 44, 46, 47, 48, 78, 79, 83, 84, 45, 49, 77, 85, 50, 58, 59, 63, 72, 76, 86, 90
Offset: 0

Views

Author

Rémy Sigrist, Mar 16 2024

Keywords

Comments

Row 0 has 1 term; for n > 0, row n has A225081(n-1) terms.
As a flat sequence, this is a permutation of the nonnegative integers, with inverse A371266.

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  ------------------------------
   0  0
   1  1
   2  2, 3
   3  4
   4  5, 9
   5  6, 7, 8, 10
   6  11, 12
   7  13
   8  14, 27
   9  15, 16, 26, 28
  10  17, 19, 20, 21, 24, 25, 29, 30
  11  18, 22, 23, 31
  12  32, 36
  13  33, 34, 35, 37
  14  38, 39
  15  40
.
Triangle T(n, k) begins, in balanced ternary, with row indexes in binary:
  bin(n)  n-th row in balanced ternary
  ------  ----------------------------------------------
       0  0
       1  1
      10  1T, 10
      11  11
     100  1TT, 100
     101  1T0, 1T1, 10T, 101
     110  11T, 110
     111  111
    1000  1TTT, 1000
    1001  1TT0, 1TT1, 100T, 1001
    1010  1T0T, 1T01, 1T1T, 1T10, 10T0, 10T1, 101T, 1010
    1011  1T00, 1T11, 10TT, 1011
    1100  11TT, 1100
    1101  11T0, 11T1, 110T, 1101
    1110  111T, 1110
    1111  1111
		

Crossrefs

See A371257 for a similar sequence.
Cf. A225081, A371266 (inverse).

Programs

  • PARI
    \\ See Links section.

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