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.

A353650 Inverse permutation to A353649.

Original entry on oeis.org

0, 1, 2, 4, 6, 5, 3, 13, 7, 9, 11, 15, 17, 20, 10, 8, 16, 12, 14, 18, 37, 39, 41, 21, 23, 25, 31, 27, 29, 33, 35, 43, 46, 48, 54, 50, 52, 56, 60, 58, 63, 28, 30, 32, 24, 22, 34, 26, 47, 49, 19, 36, 38, 40, 42, 51, 53, 55, 104, 44, 112, 114, 108, 106, 116, 110
Offset: 0

Views

Author

Rémy Sigrist, May 01 2022

Keywords

Examples

			A353649(7) = 8 so a(8) = 7.
		

Crossrefs

Cf. A353649.

Programs

  • PARI
    See Links section.

A353648 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n and a(n) can be added without carries in balanced ternary.

Original entry on oeis.org

0, 2, 1, 5, 6, 3, 4, 17, 15, 14, 18, 16, 19, 23, 9, 8, 11, 7, 10, 12, 51, 50, 53, 13, 44, 45, 42, 41, 47, 43, 46, 54, 48, 49, 56, 52, 55, 57, 69, 68, 71, 27, 26, 29, 24, 25, 30, 28, 32, 33, 21, 20, 35, 22, 31, 36, 34, 37, 149, 153, 152, 155, 150, 151, 156, 154
Offset: 0

Views

Author

Rémy Sigrist, May 01 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence is a self-inverse permutation of the nonnegative integers with a single fixed point: a(0) = 0.

Examples

			The first terms, in decimal and in balanced ternary, are:
  n         |  0   1   2    3    4    5    6     7     8     9    10    11    12
  a(n)      |  0   2   1    5    6    3    4    17    15    14    18    16    19
  bter(n)   |  0   1  1T   10   11  1TT  1T0   1T1   10T   100   101   11T   110
  bter(a(n))|  0  1T   1  1TT  1T0   10   11  1T0T  1TT0  1TTT  1T00  1TT1  1T01
		

Crossrefs

Cf. A059095, A238757 (binary analog), A353649.

Programs

  • PARI
    ok(u, v) = { while (u && v, my (uu=[0, +1, -1][1+u%3], vv=[0, +1, -1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); 1 }
    { s=0; for (n=0, 65, for (v=0, oo, if (!bittest(s,v) && ok(n,v), print1 (v", "); s+=2^v; break))) }
Showing 1-2 of 2 results.