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

A371461 Lexicographically latest sequence of distinct nonnegative integers such that for any n >= 0, A371442(a(n)) = A371442(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

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

Examples

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

Crossrefs

Cf. A371442.

Programs

  • PARI
    \\ See Links section.

A371459 For any positive integer with binary digits (b_1, ..., b_w) (where b_1 = 1), the binary digits of a(n), possibly with leading zeros, are (b_2, b_4, ..., b_{floor(w/2) * 2}); a(0) = 0.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 3, 2, 3, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 0, 0, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

In other words, we keep even-indexed bits.
Every integer appears infinitely many times in the sequence.

Examples

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

Crossrefs

See A371442 for the sequence related to odd-indexed bits.
See A059906 and A063695 for similar sequences.

Programs

  • Mathematica
    A371459[n_] := FromDigits[IntegerDigits[n, 2][[2;;-1;;2]], 2];
    Array[A371459, 100, 0] (* Paolo Xausa, Mar 28 2024 *)
  • PARI
    a(n) = { my (b = binary(n)); fromdigits(vector(#b\2, k, b[2*k]), 2); }
    
  • Python
    def A371459(n): return int(bin(n)[3::2],2) if n>1 else 0 # Chai Wah Wu, Mar 27 2024

Formula

a(n) = 0 iff n belongs to A126684.
a(A000695(n)) = 0.
a(A001196(n)) = n.

A377414 a(n) is the largest term of A126684, say b, such that n AND b = b (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 4, 5, 8, 8, 10, 10, 8, 8, 10, 10, 16, 17, 16, 17, 20, 21, 20, 21, 16, 17, 16, 17, 20, 21, 20, 21, 32, 32, 34, 34, 32, 32, 34, 34, 40, 40, 42, 42, 40, 40, 42, 42, 32, 32, 34, 34, 32, 32, 34, 34, 40, 40, 42, 42, 40, 40, 42, 42, 64, 65, 64, 65
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2024

Keywords

Comments

For any n > 0 with binary expansion (b_1 = 1, b_2, ..., b_k), the binary expansion of a(n) is (c_1, ..., c_k) where c_i = b_i when i is odd, c_i = 0 when i is even.
For any n, the value c = n - a(n) also belongs to A126684 and satisfies n AND c = c (see A377415).

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     2      10         10
   3     2      11         10
   4     4     100        100
   5     5     101        101
   6     4     110        100
   7     5     111        101
   8     8    1000       1000
   9     8    1001       1000
  10    10    1010       1010
  11    10    1011       1010
  12     8    1100       1000
  13     8    1101       1000
  14    10    1110       1010
  15    10    1111       1010
		

Crossrefs

See A063694, A063695 and A374356 for similar sequences.

Programs

  • PARI
    a(n) = { my (v = 0, x = exponent(n), y); while (n, n -= 2^y = exponent(n); if (x%2 == y%2, v += 2^y;);); return (v); }

Formula

a(n) <= n with equality iff n belongs to A126684.
a(a(n)) = a(n).
a(2*n) = 2*a(n).
a(n) = n AND A000975(A070939(n)). - Alan Michael Gómez Calderón, Jun 27 2025
Showing 1-3 of 3 results.