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.

Previous Showing 21-23 of 23 results.

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

Original entry on oeis.org

0, 4, 5, 6, 1, 2, 3, 28, 32, 33, 34, 29, 30, 31, 35, 39, 40, 41, 36, 37, 38, 42, 46, 47, 48, 43, 44, 45, 7, 11, 12, 13, 8, 9, 10, 14, 18, 19, 20, 15, 16, 17, 21, 25, 26, 27, 22, 23, 24, 196, 200, 201, 202, 197, 198, 199, 224, 228, 229, 230, 225, 226, 227, 231
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) = (A334492(n), A334493(n)).

Examples

			The first terms, in decimal and in base 7, are:
  n   a(n)  s(n)  s(a(n))
  --  ----  ----  -------
   0     0     0        0
   1     4     1        4
   2     5     2        5
   3     6     3        6
   4     1     4        1
   5     2     5        2
   6     3     6        3
   7    28    10       40
   8    32    11       44
   9    33    12       45
  10    34    13       46
		

Crossrefs

See A004488, A048647 and A348354 for similar sequences.

Programs

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

A361946 If the base-4 expansion of n starts with the digit 1, then replace 2's by 3's and vice versa; if it starts with the digit 2, then replace 1's by 3's and vice versa; if it starts with the digit 3, then replace 1's by 2's and vice versa; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 01 2023

Keywords

Comments

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

Examples

			For n = 539:
- the base-4 expansion of 539 is "20123",
- it starts with the digit 2, so we replace 1's by 3's and vice versa,
- so the base-4 expansion of a(539) is "20321", and a(539) = 569.
		

Crossrefs

Programs

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

Formula

a(n) = A163241(n) when A122587(n) = 1.
a(n) = A048647(n) when A122587(n) = 2.
a(n) = A057300(n) when A122587(n) = 3.
a(n) = n iff n = d * A000695(k) for some d in {1, 2, 3} and some k >= 0.

A361947 If the rightmost nonzero digit in the base-4 expansion of n is the digit 1, then replace 2's by 3's and vice versa; if it is the digit 2, then replace 1's by 3's and vice versa; if it is the digit 3, then replace 1's by 2's and vice versa; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 01 2023

Keywords

Comments

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

Examples

			For n = 539:
- the base-4 expansion of 539 is "20123",
- the rightmost nonzero digit is 3, so we replace 1's by 2's and vice versa,
- so the base-4 expansion of a(539) is "10213", and a(539) = 295.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (m = if (n, [ [0,1,3,2], [0,3,2,1], [0,2,1,3] ][(n / 4^valuation(n, 4)) % 4], [0,1,2,3])); fromdigits(apply (d -> m[1+d], digits(n, 4)), 4); }

Formula

a(n) = A163241(n) when A065882(n) = 1.
a(n) = A048647(n) when A065882(n) = 2.
a(n) = A057300(n) when A065882(n) = 3.
a(n) = n iff n = d * A000695(k) for some d in {1, 2, 3} and some k >= 0.
Previous Showing 21-23 of 23 results.