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

A154440 Permutation of nonnegative integers: the inverse of A154439.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Crossrefs

Inverse: A154439. a(n) = A153141(A154446(n)) = A054429(A154444(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154442-A154448. Corresponds to A154450 in the group of Catalan bijections.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A154441 Permutation of nonnegative integers induced by Basilica group generating wreath recursion: a = (1,b), b = s(1,a), starting from the active (swapping) state b.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Comments

This permutation is induced by the Basilica group generating wreath recursion a = (1,b), b = s(1,a) (i.e. binary transducer, where s means that the bits at that state are toggled: 0 <-> 1) given on the page 40 of Bartholdi and Virag paper, starting from the active (switching) state b and rewriting bits from the second most significant bit to the least significant end.

Examples

			Starting from the second most significant bit, we continue complementing every second bit (in this case, starting from the second most significant bit), as long as the first zero is encountered, which is also complemented if its distance to the most significant bit is odd, after which the remaining bits are left intact. E.g. 121 = 1111001 in binary. Complementing its second and fourth most significant bits (positions 5 & 3) and stopping at the first zero-bit at position 2 (which is not complemented, as its distance to the msb is 6), we obtain "10100.." after which the rest of the bits stay same, so we get 1010001, which is 81's binary representation, thus a(121)=81. On the other hand, 125 = 1111101 in binary and the transducer complements the bits at positions 5, 3 and also the first zero at the position 1 (because at odd distance from the msb), yielding 101011., after which the remaining bit stays same, thus we get 1010111, which is 87's binary representation, thus a(125)=87.
		

References

  • R. I. Grigorchuk and A. Zuk, Spectral properties of a torsion free weakly branch group defined by a three state automaton, Contemporary Mathematics 298 (2002), 57--82.

Crossrefs

Inverse: A154442. a(n) = A154443(A153142(n)) = A054429(A154445(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154448. Corresponds to A154451 in the group of Catalan bijections.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A154443 Permutation of nonnegative integers induced by Basilica group generating wreath recursion: a = (b,1), b = s(a,1), starting from the inactive (fixing) state a.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Crossrefs

Inverse: A154444. a(n) = A154441(A153141(n)) = A054429(A154439(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154448. Corresponds to A154453 in the group of Catalan bijections.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A154445 Permutation of nonnegative integers induced by Basilica group generating wreath recursion: a = (b,1), b = s(a,1), starting from the active (swapping) state b.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Crossrefs

Inverse: A154446. a(n) = A154439(A153141(n)) = A054429(A154441(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154448. Corresponds to A154455 in the group of Catalan bijections.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A153152 Rotated binary incrementing: For n<2 a(n)=n, if n=(2^k)-1, a(n)=(n+1)/2, otherwise a(n)=n+1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2008

Keywords

Comments

A002487(n)/A002487(n+1), n > 0, runs through all the reduced nonnegative rationals exactly once. A002487 is the Stern's sequence. A002487(a(n)) = A002487(n+1) n>0 . - Yosu Yurramendi, Jul 07 2016

Crossrefs

Inverse: A153151.

Programs

  • Maple
    a := n -> if n < 2 then n elif convert(convert(n+1, base, 2), `+`) = 1 then (n+1)/2 else n+1 fi: seq(a(n), n=0..71); # Peter Luschny, Jul 16 2016
  • Mathematica
    Table[If[IntegerQ@ Log2[n + 1], (n + 1)/2, n + 1], {n, 0, 71}] /. Rational -> 0 (* _Michael De Vlieger, Jul 13 2016 *)
  • Python
    def ok(n): return n&(n - 1)==0
    def a(n): return n if n<2 else (n + 1)/2 if ok(n + 1) else n + 1 # Indranil Ghosh, Jun 09 2017
    
  • R
    maxlevel <- 5 # by choice
    a <- 1
    for(m in 1:maxlevel){
     a[2^m        ] <- 2^m + 1
     a[2^(m+1) - 1] <- 2^m
     for (k in 0:(2^m-2)){
       a[2^(m+1) + 2*k + 1] <- 2*a[2^m + k]
       a[2^(m+1) + 2*k + 2] <- 2*a[2^m + k] + 1}
    }
    a <- c(0, a)
    # Yosu Yurramendi, Sep 05 2020

A154444 Permutation of nonnegative integers: The inverse of A154443.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Crossrefs

Inverse: A154443. a(n) = A153142(A154442(n)) = A054429(A154440(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154448. Corresponds to A154454 in the group of Catalan bijections.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A154447 Permutation of nonnegative integers induced by wreath recursion a=s(b,c), b=s(c,a), c=(c,c), starting from state b, rewriting bits from the second most significant bit toward the least significant end.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Comments

This permutation of natural numbers is induced by the second generator of group 2861 mentioned on page 144 of "Classification of groups generated by 3-state automata over a 2-letter alphabet" paper. It can be computed by starting scanning n's binary expansion rightward from the second most significant bit, complementing every bit down to and including A) either the first 0-bit at odd distance from the most significant bit or B) the first 1-bit at even distance from the most significant bit.

Examples

			25 = 11001 in binary, the first zero-bit at odd distance from the msb is at position 1 (distance 3) and the first one-bit at even distance from the msb is at position 0 (distance 4), thus we stop at the former, after complementing the bits 3-1, which gives us 10111 (23 in binary), thus a(25)=23.
		

Crossrefs

Inverse: A154448. a(n) = A054429(A154448(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154446. Corresponds to A154457 in the group of Catalan bijections.

Programs

  • R
    maxlevel <- 5 # by choice
    a <- 1
    for(m in 0:maxlevel) {
      for(k in 0:(2^m-1)) {
      a[2^(m+1) + 2*k    ] <- 2*a[2^m + k]
      a[2^(m+1) + 2*k + 1] <- 2*a[2^m + k] + 1
      }
      x <- floor(2^m*5/3)
      a[2*x    ] <- 2*a[x] + 1
      a[2*x + 1] <- 2*a[x]
    }
    (a <- c(0, a))
    # Yosu Yurramendi, Oct 12 2020

A316472 Inverse permutation to A316385.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 04 2018

Keywords

Examples

			A316385(42) = 50 hence a(50) = 42.
		

Crossrefs

Programs

  • PARI
    b1(n) = my(b=binary(n)); fromdigits(concat(b[1], Vecrev(vector(#b-1, k, b[k+1]))), 2); \\ A059893
    b2(n) = if(n < 2, n, if((n + 1) == 2^logint(n + 1, 2), (n + 1) / 2, n + 1)) \\ A153152
    a(n) = my(A = 2^logint(n, 2), B = b1(b2(b1(n))) - A); (2 * B + 1) * A / 2 ^ (if(B == 0, -1, logint(B, 2)) + 1) \\ Mikhail Kurkov, Sep 09 2023 [verification needed]

Formula

a(n) = (2*b(n) + 1)*2^(L(n) - L(b(n)) - 1) where b(n) = A053645(A153142(n)) and where L(n) = A000523(n) for n > 0 with L(0) = -1. - Mikhail Kurkov, Sep 09 2023 [verification needed]
Previous Showing 11-18 of 18 results.