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.

A333693 Inverse permutation to A333692.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 04 2020

Keywords

Examples

			A333692(90) = 86, hence a(86) = 90.
		

Crossrefs

Programs

  • PARI
    a(n,base=2) = { if (n==0, 0, n%base==0, base*a(n/base, base), my (r=fromdigits(Vecrev(digits(n, base)), base)); base*a(r\base, base)+(r%base)) }

Formula

a(2*n) = 2*a(n).

A333762 Fixed points of A333692.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 28, 30, 31, 32, 33, 34, 36, 40, 42, 48, 55, 56, 60, 62, 63, 64, 65, 66, 68, 72, 73, 80, 84, 85, 96, 103, 110, 112, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 146, 160, 168, 170, 181
Offset: 1

Views

Author

Rémy Sigrist, Apr 04 2020

Keywords

Comments

For any n >= 0, n belongs to this sequence iff 2*n also belongs to this sequence.
This sequence contains A000079, A000225, A018900, A023758, A295235.

Crossrefs

Programs

  • PARI
    is(n, base=2)={ my (b=digits(n, base), p=[]); for (k=1, #b, p=concat(p, b[k]); if (b[k], p=Vecrev(p))); n==fromdigits(p, base) }

A333776 Scan the binary representation of n from right to left; at each 1, reverse the bits to the right and excluding this 1. The resulting binary representation is that of a(n).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 05 2020

Keywords

Comments

This sequence is a permutation of the nonnegative integers (as it is injective and preserves the binary length); see A333777 for the inverse.
We can devise a variant of this sequence for any fixed base b > 1, by performing a reversal at each nonzero digit in base b.

Examples

			For n = 90:
- the binary representation of 90 is "1011010",
- this binary representation evolves as follows (parentheses indicate reversals):
    1 0 1 1 0 1(0)
    1 0 1 1(0 1 0)
    1 0 1(0 1 0 1)
    1(1 0 1 0 1 0)
- the resulting binary representation is "1101010"
- and a(90) = 106.
The binary plot of the first terms is as follows (#'s denote 1's):
                                  ################################
                  ################ # #  ##    ####        ########
          ######## # #  ##    ####  ## # #  ## # #    #### # #  ##
      #### # #  ##  ## # #  ## # #    #### # #  ##  ## # #  ## # #
    ## # #  ## # #    #### # #  ##        ######## # #  ##    ####
   # #  ##    ####        ########                ################
            1         2         3         4         5         6
  0123456789012345678901234567890123456789012345678901234567890123
		

Crossrefs

See A333692 for a similar sequence.
Cf. A000120, A330081, A333777 (inverse), A333778 (fixed points).

Programs

  • PARI
    a(n, base=2) = { my (d=digits(n, base), t=[]); forstep (k=#d, 1, -1, if (d[k], t=Vecrev(t)); t=concat(d[k], t)); fromdigits(t, base); }

Formula

a(2*n) <= 2*a(n) with equality iff n = 0 or n is a power of 2.
A000120(a(n)) = A000120(n).
Showing 1-3 of 3 results.