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

A348354 The base-5 expansion of a(n) is obtained by replacing 1's, 2's, 3's and 4's by 3's, 4's, 1's and 2's, respectively, in the base-5 expansion of n.

Original entry on oeis.org

0, 3, 4, 1, 2, 15, 18, 19, 16, 17, 20, 23, 24, 21, 22, 5, 8, 9, 6, 7, 10, 13, 14, 11, 12, 75, 78, 79, 76, 77, 90, 93, 94, 91, 92, 95, 98, 99, 96, 97, 80, 83, 84, 81, 82, 85, 88, 89, 86, 87, 100, 103, 104, 101, 102, 115, 118, 119, 116, 117, 120, 123, 124, 121
Offset: 0

Views

Author

Rémy Sigrist, Oct 14 2021

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
It is possible to build a similar sequence for any fixed base b > 1 and any permutation p of {1, ..., b-1}.
This sequence is interesting as it satisfies f(a(n)) = -f(n), where f(n) = (A316657(n), A316658(n)).

Examples

			The first terms, in decimal and in base 5, are:
  n   a(n)  q(n)  q(a(n))
  --  ----  ----  -------
   0     0     0        0
   1     3     1        3
   2     4     2        4
   3     1     3        1
   4     2     4        2
   5    15    10       30
   6    18    11       33
   7    19    12       34
   8    16    13       31
   9    17    14       32
  10    20    20       40
		

Crossrefs

See A004488, A048647 and A348355 for similar sequences.

Programs

  • Mathematica
    a[n_] := With[{d = {0, 3, 4, 1, 2}}, FromDigits[d[[IntegerDigits[n, 5] + 1]], 5]]; Array[a, 64, 0] (* Amiram Eldar, Oct 16 2021 *)
  • PARI
    a(n, p=[3,4,1,2]) = fromdigits(apply(d -> if (d, p[d], 0), digits(n, #p+1)), #p+1)

Formula

A316657(n) + A316657(a(n)) = 0.
A316658(n) + A316658(a(n)) = 0.
Showing 1-1 of 1 results.