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

A333659 a(n) is the greatest number m not yet in the sequence such that the decimal expansions of n and of m have the same digits (up to order but with multiplicity).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 31, 41, 51, 61, 71, 81, 91, 20, 12, 22, 32, 42, 52, 62, 72, 82, 92, 30, 13, 23, 33, 43, 53, 63, 73, 83, 93, 40, 14, 24, 34, 44, 54, 64, 74, 84, 94, 50, 15, 25, 35, 45, 55, 65, 75, 85, 95, 60, 16, 26, 36, 46, 56, 66, 76
Offset: 0

Views

Author

Rémy Sigrist, Sep 02 2020

Keywords

Comments

Leading 0's are ignored.
This sequence is a permutation of the nonnegative integers, which preserves the number of digits (A055642) and the sum of digits (A007953).
This sequence first differs from A321474 and A336956 for n = 101: a(101) = 110 whereas A321474(101) = A336956(101) = 101.

Examples

			For n = 255:
- there are three numbers with the same multiset of digits: 255, 525 and 552,
- so a(255) = 552,
     a(525) = 525,
     a(552) = 255.
		

Crossrefs

See A333658, A337305 and A337598 for similar sequences.
See A331274 for the binary variant.

Programs

  • PARI
    See Links section.

Formula

a(10^n) = 10^n for any n >= 0.

A331275 a(n) is the greatest ternary anagram of n not yet in the sequence.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 13 2020

Keywords

Comments

Leading zeros are ignored.
This sequence is a self-inverse permutation of the natural numbers.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   1     1       1          1
   2     2       2          2
   3     3      10         10
   4     4      11         11
   5     7      12         21
   6     6      20         20
   7     5      21         12
   8     8      22         22
   9     9     100        100
  10    12     101        110
  11    21     102        210
  12    10     110        101
  13    13     111        111
  14    22     112        211
  15    19     120        201
		

Crossrefs

Cf. A331274 (binary analog).

Programs

  • PARI
    See Links section.

A337242 a(n) is the greatest number m not yet in the sequence such that the binary expansions of m and of n have the same run lengths (up to order but with multiplicity).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 21 2020

Keywords

Comments

This sequence has similarities with A331274; here we consider run lengths in binary expansions, there binary digits.
This sequence is a self-inverse permutation of the nonnegative numbers.
This sequence preserves the number of binary digits (A070939) and the number of runs in binary expansions (A005811).
This sequence has interesting graphical features (see Links section).

Examples

			For n = 7280:
- 7280 has binary expansion "1110001110000",
- the corresponding run lengths are: {3, 3, 3, 4},
- there are four numbers k with the same multiset of run lengths:
    k     bin(k)           run lengths
    ----  ---------------  -----------
    7224  "1110000111000"  {3, 4, 3, 3}
    7280  "1110001110000"  {3, 3, 3, 4}
    7288  "1110001111000"  {3, 3, 4, 3}
    7736  "1111000111000"  {4, 3, 3, 3}
- so a(7224) = 7736,
     a(7280) = 7288,
     a(7288) = 7280,
     a(7736) = 7224.
		

Crossrefs

Programs

  • Mathematica
    Nest[Function[{a, m}, Append[a, SelectFirst[m, FreeQ[a, #] &]]] @@ {#1, Sort[Map[FromDigits[Join @@ MapIndexed[ConstantArray[Boole[OddQ@ First[#2]], #1] &, #], 2] &, Permutations[Length /@ Split@ IntegerDigits[#2, 2]]], Greater]} & @@ {#, Length@ #} &, {0}, 66] (* Michael De Vlieger, Aug 22 2020 *)
  • PARI
    See Links section.

Formula

a(2^k-1) = 2^k-1 for any k >= 0.

A342102 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, {A000120(n), A080791(n)} = {A000120(a(n)), A080791(a(n))}.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 28 2021

Keywords

Comments

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

Examples

			The first terms, in decimal and in binary, alongside {A000120(n), A080791(n)}, are:
  n   a(n)  bin(n)  bin(a(n))  {A000120(n), A080791(n)}
  --  ----  ------  ---------  ------------------------
   0     0       0          0  {0}
   1     1       1          1  {0, 1}
   2     2      10         10  {1}
   3     3      11         11  {0, 2}
   4     6     100        110  {1, 2}
   5     5     101        101  {1, 2}
   6     4     110        100  {1, 2}
   7     7     111        111  {0, 3}
   8    14    1000       1110  {1, 3}
   9    12    1001       1100  {2}
  10    10    1010       1010  {2}
  11    13    1011       1101  {1, 3}
  12     9    1100       1001  {2}
  13    11    1101       1011  {1, 3}
  14     8    1110       1000  {1, 3}
  15    15    1111       1111  {0, 4}
		

Crossrefs

See A342115, A342116 and A342117 for similar sequences.

Programs

  • PARI
    \\ See Links section.

Formula

a(2^k-1) = 2^k-1 for any k >= 0.
a(n) < 2^k for any n < 2^k.

A338829 a(n) is the greatest number not yet in the sequence with the same number of digits and the same sum of digits as n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 91, 11, 21, 31, 41, 51, 61, 71, 81, 82, 92, 12, 22, 32, 42, 52, 62, 72, 73, 83, 93, 13, 23, 33, 43, 53, 63, 64, 74, 84, 94, 14, 24, 34, 44, 54, 55, 65, 75, 85, 95, 15, 25, 35, 45, 46, 56, 66, 76
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
We have a fixed point with m digits and sum of digits k whenever A289410(m, k) is odd.

Examples

			For n = 23:
- the numbers with 2 digits and sum of digits 5 are: 14, 23, 32, 41 and 50,
- so  a(14) = 50,
      a(23) = 41,
      a(32) = 32,
      a(41) = 23,
      a(50) = 14.
		

Crossrefs

Cf. A055642, A289410, A331274 (binary analog), A333659, A338834 (factorial base analog), A338835 (primorial base analog).

Programs

  • Mathematica
    Block[{a = {}, f, k}, f[x_] := Total@ IntegerDigits@ x; Do[k = f[i]; AppendTo[a, SelectFirst[Range[10^# - 1, 10^(# - 1), -1] &@ Floor[1 + Log10[i]], And[f[#] == k, FreeQ[a, #]] &]], {i, 67}]; a] (* Michael De Vlieger, Nov 13 2020 *)
  • PARI
    See Links section.

Formula

A055642(a(n)) = A055642(n).
A007953(a(n)) = A007953(n).

A338698 Lexicographically latest sequence of distinct nonnegative terms such that for any n >= 0, n and a(n) have the same number of 0's and the same number of 1's in their Zeckendorf-binary representations.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 6, 8, 11, 10, 9, 12, 13, 18, 16, 15, 20, 14, 19, 17, 21, 29, 26, 24, 32, 23, 31, 30, 22, 28, 27, 25, 33, 34, 47, 42, 39, 52, 37, 50, 49, 36, 48, 45, 44, 54, 35, 43, 41, 40, 53, 38, 51, 46, 55, 76, 68, 63, 84, 60, 81, 79, 58, 78, 77, 73, 87
Offset: 0

Views

Author

Rémy Sigrist, Apr 24 2021

Keywords

Comments

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

Examples

			The first terms, alongside their Zeckendorf-binary representation, are:
  n   a(n)  zeck(n)  zeck(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     2       10          10
   3     3      100         100
   4     4      101         101
   5     5     1000        1000
   6     7     1001        1010
   7     6     1010        1001
   8     8    10000       10000
   9    11    10001       10100
  10    10    10010       10010
  11     9    10100       10001
  12    12    10101       10101
  13    13   100000      100000
  14    18   100001      101000
  15    16   100010      100100
  16    15   100100      100010
  17    20   100101      101010
  18    14   101000      100001
  19    19   101001      101001
  20    17   101010      100101
		

Crossrefs

Cf. A000045, A007895, A072649, A014417, A331274 (binary variant).

Programs

  • PARI
    See Links section.

Formula

A007895(a(n)) = A007895(n).
A072649(a(n)) = A072649(n) for any n > 0.
a(A000045(n)) = A000045(n).

A371343 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of n and of a(n) have the same length (A070939) and the same number of runs of consecutive equals digits (A005811).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers with infinitely many fixed points (for example, all terms of A000225 are fixed points).

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     6     100        110
   5     5     101        101
   6     4     110        100
   7     7     111        111
   8    14    1000       1110
   9    13    1001       1101
  10    10    1010       1010
  11    11    1011       1011
  12    12    1100       1100
  13     9    1101       1001
  14     8    1110       1000
  15    15    1111       1111
		

Crossrefs

See A331274 and A337242 for similar sequences.

Programs

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