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.

A372317 For any n > 0 with leading ternary digit h = A122586(n), reverse digits in blocks in ternary expansion of n where blocks are separated by h's; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 27 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
This sequence has infinitely many fixed points (A125292, among others).

Examples

			For n = 5323: the ternary expansion of 5323 is "21022011", the corresponding leading digit is "2", we have three blocks: "10", "" and "011", their reversals are: "01", "" and "110", so the ternary expansion of a(5323) is "20122110", and a(5323) = 4845.
		

Crossrefs

See A367307 and A372318 for similar sequences.

Programs

  • PARI
    a(n, base = 3) = { my (d = digits(n, base), i = 1); for (j = 2, #d+1, if (j==#d+1 || d[i]==d[j], my (ii = i+1, jj = j-1); while (ii < jj, [d[ii], d[jj]] = [d[jj], d[ii]]; ii++; jj--;); i = j;);); fromdigits(d, base); }

A377440 Lexicographically latest sequence of nonnegative integers such that for any n >= 0, A265263(n) = A265263(a(n)).

Original entry on oeis.org

0, 1, 3, 2, 6, 5, 4, 7, 12, 10, 9, 13, 8, 11, 15, 14, 24, 20, 18, 25, 17, 21, 27, 26, 16, 19, 23, 22, 30, 29, 28, 31, 48, 40, 36, 49, 34, 41, 51, 50, 33, 37, 43, 42, 54, 53, 52, 55, 32, 35, 39, 38, 46, 45, 44, 47, 60, 58, 57, 61, 56, 59, 63, 62, 96, 80, 72, 97
Offset: 0

Views

Author

Rémy Sigrist, Oct 28 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers that preserves the binary length.

Examples

			The first terms are:
  n   a(n)  A265263(n)  A265263(a(n))
  --  ----  ----------  -------------
   0     0           0              0
   1     1           1              1
   2     3           2              2
   3     2           2              2
   4     6           4              4
   5     5           4              4
   6     4           4              4
   7     7           5              5
   8    12           8              8
   9    10           8              8
  10     9           8              8
  11    13           9              9
  12     8           8              8
  13    11           9              9
  14    15          10             10
  15    14          10             10
		

Crossrefs

Programs

  • PARI
    \\ See Links section.
Showing 1-2 of 2 results.