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

A331274 a(n) is the greatest binary anagram of n not yet in the sequence.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 12, 10, 14, 9, 13, 11, 15, 16, 24, 20, 28, 18, 26, 25, 30, 17, 22, 21, 29, 19, 27, 23, 31, 32, 48, 40, 56, 36, 52, 50, 60, 34, 49, 44, 58, 42, 57, 54, 62, 33, 41, 38, 53, 37, 51, 46, 61, 35, 45, 43, 59, 39, 55, 47, 63, 64, 96, 80, 112
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 binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     4     100        100
   5     6     101        110
   6     5     110        101
   7     7     111        111
   8     8    1000       1000
   9    12    1001       1100
  10    10    1010       1010
  11    14    1011       1110
  12     9    1100       1001
  13    13    1101       1101
  14    11    1110       1011
  15    15    1111       1111
		

Crossrefs

Cf. A007318, A187769, A298847, A331275 (ternary analog).

Programs

  • PARI
    \\ See Links section.

Formula

a(A187769(n, k)) = A187769(n, A007318(n-1)+1-k) for any n > 0 and k = 1..A007318(n-1).

A302544 Lexicographically earliest sequence of distinct nonnegative numbers such that for any n >= 0, A065359(a(n)) = - A065359(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 09 2018

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative numbers, with fixed points A039004.
We can build an analog of this sequence for any base b > 1 by considering the alternating sum of digits in base b instead of A065359.
This sequence has similarities with A298847.
The scatter plots have an interesting, "fibrous" look. - Antti Karttunen, Jul 21 2018

Examples

			The first terms, alongside the binary representations of n and of a(n), and A065359(n), are:
  n   a(n)  bin(n)  bin(a(n))  A065359(n)
  --  ----  ------  ---------  ----------
   0     0       0       0      0
   1     2       1      10      1
   2     1      10       1     -1
   3     3      11      11      0
   4     8     100    1000      1
   5    10     101    1010      2
   6     6     110     110      0
   7    11     111    1011      1
   8     4    1000     100     -1
   9     9    1001    1001      0
  10     5    1010     101     -2
  11     7    1011     111     -1
  12    12    1100    1100      0
  13    14    1101    1110      1
  14    13    1110    1101     -1
  15    15    1111    1111      0
  16    26   10000   11010      1
  17    34   10001  100010      2
  18    18   10010   10010      0
  19    32   10011  100000      1
  20    40   10100  101000      2
		

Crossrefs

Cf. A039004 (fixed points), A065359, A298847.

A341910 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the number of runs in the binary expansion of n equals the number of ones in the binary expansion of a(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 23 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A341911.
Apparently, A037481 corresponds to the fixed points of this sequence.

Examples

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

Crossrefs

Programs

  • Mathematica
    Block[{a = {0}, k}, Do[k = 1; While[Nand[FreeQ[a, k], DigitCount[k, 2, 1] == #], k++] &@ Length[Split@ IntegerDigits[i, 2]]; AppendTo[a, k], {i, 67}]; a] (* Michael De Vlieger, Feb 24 2021 *)
  • PARI
    See Links section.

Formula

A005811(n) = A000120(a(n)).
a(n) < 2^k for any n < 2^k.

A341911 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the number of ones in the binary expansion of n equals the number of runs in the binary expansion of a(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 23 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A341910.

Examples

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

Crossrefs

Cf. A000120, A005811, A298847, A341910 (inverse).

Programs

  • Mathematica
    Block[{a = {0}, k}, Do[k = 1; While[Nand[FreeQ[a, k], Length[Split@ IntegerDigits[k, 2]] == #], k++] &@ DigitCount[i, 2, 1]; AppendTo[a, k], {i, 66}]; a] (* Michael De Vlieger, Feb 24 2021 *)
  • PARI
    See Links section.

Formula

A000120(n) = A005811(a(n)).
a(n) < 2^k for any n < 2^k.
Showing 1-4 of 4 results.