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-10 of 34 results. Next

A286596 a(n) = A278222(A153141(n)).

Original entry on oeis.org

1, 2, 4, 2, 8, 4, 2, 6, 16, 8, 4, 12, 2, 6, 6, 12, 32, 16, 8, 24, 4, 12, 12, 36, 2, 6, 6, 12, 6, 30, 12, 24, 64, 32, 16, 48, 8, 24, 24, 72, 4, 12, 12, 36, 12, 60, 36, 72, 2, 6, 6, 12, 6, 30, 12, 24, 6, 30, 30, 60, 12, 60, 24, 48, 128, 64, 32, 96, 16, 48, 48, 144, 8, 24, 24, 72, 24, 120, 72, 216, 4, 12, 12, 36, 12, 60, 36, 72, 12
Offset: 0

Views

Author

Antti Karttunen, Jun 04 2017

Keywords

Crossrefs

Cf. A153141, A278222, A286597 (rgs-version of this sequence), A286598.

Programs

Formula

a(n) = A278222(A153141(n)).

A069768 Signature-permutation of Catalan bijection "Knack".

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 16 2002; entry revised Dec 20 2008

Keywords

Comments

This automorphism of binary trees first swaps the left and right subtree of the root and then proceeds recursively to the (new) left subtree, to do the same operation there. This is one of those Catalan bijections which extend to a unique automorphism of the infinite binary tree, which in this case is A153142. See further comments there and in A153141.
This bijection, Knack, is a ENIPS-transformation of the simple swap: ENIPS(*A069770) (i.e., row 1 of A122204). Furthermore, Knack and Knick (the inverse, A069767) have a special property, that FORK and KROF transforms (explained in A122201 and A122202) transform them to their own inverses, i.e., to each other: FORK(Knick) = KROF(Knick) = Knack and FORK(Knack) = KROF(Knack) = Knick, thus this occurs also as row 1 in A122288 and naturally, the double-fork fixes both, e.g., FORK(FORK(Knack)) = Knack.
Note: the name in Finnish is "Naks".

References

  • A. Karttunen, paper in preparation.

Crossrefs

Inverse permutation: "Knick", A069767. "n-th powers" (i.e. n-fold applications), from n=2 to 6: A073291, A073293, A073295, A073297, A073299.
In range [A014137(n-1)..A014138(n-1)] of this permutation, the number of cycles is A073431, number of fixed points: A036987 (Fixed points themselves: A084108), Max. cycle size & LCM of all cycle sizes: A011782. See also: A074080.
A127302(a(n)) = A127302(n) for all n. a(n) = A057162(A057508(n)) = A069769(A057162(n))
Row 1 of A122204 and A122288, row 21 of A122285 and A130402, row 8 of A073200.
See also bijections A073287, A082346, A082347, A082350, A130342.

A069767 Signature-permutation of Catalan bijection "Knick".

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 16 2002; entry revised Dec 20 2008

Keywords

Comments

This automorphism of binary trees first swaps the left and right subtree of the root and then proceeds recursively to the (new) right subtree, to do the same operation there. This is one of those Catalan bijections which extend to a unique automorphism of the infinite binary tree, which in this case is A153141. See further comments there.
This bijection, Knick, is a SPINE-transformation of the simple swap: SPINE(*A069770) (i.e., row 1 of A122203). Furthermore, Knick and Knack (the inverse, *A069768) have a special property, that FORK and KROF transforms (explained in A122201 and A122202) transform them to their own inverses, i.e., to each other: FORK(Knick) = KROF(Knick) = Knack and FORK(Knack) = KROF(Knack) = Knick, thus this occurs also as a row 1 in A122287 and naturally, the double-fork fixes both, e.g., FORK(FORK(Knick)) = Knick. There are also other peculiar properties.
Note: the name in Finnish is "Niks".

References

  • A. Karttunen, paper in preparation.

Crossrefs

Inverse permutation: "Knack", A069768. "n-th powers" (i.e. n-fold applications), from n=2 to 6: A073290, A073292, A073294, A073296, A073298.
In range [A014137(n-1)..A014138(n-1)] of this permutation, the number of cycles is A073431, number of fixed points: A036987 (Fixed points themselves: A084108), Max. cycle size & LCM of all cycle sizes: A011782. See also: A074080.
A127302(a(n)) = A127302(n) for all n. a(n) = A057508(A057161(n)) = A057161(A069769(n)).
Row 1 of A122203 and A122287, row 15 of A122286 and A130403, row 6 of A073200.
See also bijections A073286, A082345, A082348, A082349, A130341.

A153142 Permutation of nonnegative integers: A059893-conjugate of A153152.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2008

Keywords

Comments

This sequence can be also obtained by starting complementing n's binary expansion from the second most significant bit, continuing towards lsb-end until the first 0-bit is reached, which is the last bit to be complemented.
In the Stern-Brocot enumeration system for positive rationals (A007305/A047679), this permutation converts the numerator into the denominator: A047679(n) = A007305(a(n)). - Yosu Yurramendi, Aug 30 2020

Examples

			29 = 11101 in binary. By complementing bits in (zero-based) positions 3, 2 and 1 we get 10011 in binary, which is 19 in decimal, thus a(29)=19.
		

Crossrefs

Inverse: A153141. a(n) = A059893(A153152(A059893(n))) = A059894(A153151(A059894(n))). Differs from A003188 for the first time at n=10, where a(10)=14 while A003188(10)=15. Cf. also A072376. Corresponds to A069768 in the group of Catalan bijections.

Programs

  • Python
    def ok(n): return n&(n - 1)==0
    def a153152(n): return n if n<2 else (n + 1)/2 if ok(n + 1) else n + 1
    def A(n): return (int(bin(n)[2:][::-1], 2) - 1)/2
    def msb(n): return n if n<3 else msb(n/2)*2
    def a059893(n): return A(n) + msb(n)
    def a(n): return 0 if n==0 else  a059893(a153152(a059893(n))) # Indranil Ghosh, Jun 09 2017
    
  • R
    maxlevel <- 5 # by choice
    a <- 1
    for(m in 1:maxlevel){
      a[2^(m+1) - 1] <- 2^m
      a[2^(m+1) - 2] <- 2^m + 1
      for (k in 0:(2^m-2)){
        a[2^(m+1) + 2*k    ] <- 2*a[2^m + k]
        a[2^(m+1) + 2*k + 1] <- 2*a[2^m + k] + 1}
    }
    a <- c(0, a)
    # Yosu Yurramendi, Aug 30 2020

A154435 Permutation of nonnegative integers induced by Lamplighter group generating wreath recursion, variant 3: a = s(b,a), b = (a,b), starting from the state a.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Comments

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

Examples

			475 = 111011011 in binary. Starting from the second most significant bit and, as we begin with the swapping state a, we complement the bits up to and including the first zero encountered and so the beginning of the binary expansion is complemented as 1001....., then, as we switch to the inactive state b, the following bits are kept same, again up to and including the first zero encountered, after which the binary expansion is 1001110.., after which we switch again to the active state (state a), which complements the two rightmost 1's and we obtain the final answer 100111000, which is 312's binary representation, thus a(475)=312.
		

Crossrefs

Inverse: A154436. a(n) = A059893(A154437(A059893(n))) = A054429(A006068(A054429(n))). Corresponds to A122301 in the group of Catalan bijections. Cf. also A153141-A153142, A154439-A154448, A072376.

Programs

  • Python
    from sympy import floor
    def a006068(n):
        s=1
        while True:
            ns=n>>s
            if ns==0: break
            n=n^ns
            s<<=1
        return n
    def a054429(n): return 1 if n==1 else 2*a054429(floor(n/2)) + 1 - n%2
    def a(n): return 0 if n==0 else a054429(a006068(a054429(n))) # Indranil Ghosh, Jun 11 2017
    
  • R
    maxn <- 63 # by choice
    a <- c(1,3,2) # If it were a <- 1:3, it would be A180200
    for(n in 2:maxn){
      a[2*n  ] <- 2*a[n] + (a[n]%%2 == 0)
      a[2*n+1] <- 2*a[n] + (a[n]%%2 != 0)  }
    a
    # Yosu Yurramendi, Jun 21 2020

Extensions

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

A154436 Permutation of nonnegative integers induced by Lamplighter group generating wreath recursion, variant 1: a = s(a,b), b = (a,b), starting from the state a.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Comments

This permutation is induced by the first Lamplighter group generating wreath recursion a = s(a,b), b = (a,b) (i.e. binary transducer, where s means that the bits at that state are toggled: 0 <-> 1) given on page 104 of Bondarenko, Grigorchuk, et al. paper, starting from the active (swapping) state a and rewriting bits from the second most significant bit to the least significant end. It is the same automaton as given in figure 1 on page 211 of Grigorchuk and Zuk paper. Note that the fourth wreath recursion on page 104 of Bondarenko, et al. paper induces similarly the binary reflected Gray code A003188 (A054429-reflected conjugate of this permutation) and the second one induces Gray Code's inverse permutation A006068.

Examples

			312 = 100111000 in binary. Starting from the second most significant bit and, as we begin with the swapping state a, we complement the bits up to and including the first one encountered and so the beginning of the binary expansion is complemented as 1110....., then, as we switch to the inactive state b, the following bits are kept same, up to and including the first zero encountered, after which the binary expansion is 1110110.., after which we switch again to the complementing mode (state a) and we obtain 111011011, which is 475's binary representation, thus a(312)=475.
		

Crossrefs

Inverse: A154435.
Corresponds to A122302 in the group of Catalan bijections.

Programs

  • Mathematica
    Function[s, Map[s[[#]] &, BitXor[#, Floor[#/2]] & /@ s]]@ Flatten@ Table[Range[2^(n + 1) - 1, 2^n, -1], {n, 0, 6}] (* Michael De Vlieger, Jun 11 2017 *)
  • PARI
    a003188(n) = bitxor(n, n>>1);
    a054429(n) = 3<<#binary(n\2) - n - 1;
    a(n) = if(n==0, 0, a054429(a003188(a054429(n)))); \\ Indranil Ghosh, Jun 11 2017
    
  • Python
    from sympy import floor
    def a003188(n): return n^(n>>1)
    def a054429(n): return 1 if n==1 else 2*a054429(floor(n/2)) + 1 - n%2
    def a(n): return 0 if n==0 else a054429(a003188(a054429(n))) # Indranil Ghosh, Jun 11 2017
    
  • R
    maxn <- 63 # by choice
    a <- c(1, 3, 2)
    for(n in 2:maxn){
      if(n%%2 == 0) {a[2*n] <- 2*a[n]+1 ; a[2*n+1] <- 2*a[n]}
      else          {a[2*n] <- 2*a[n]   ; a[2*n+1] <- 2*a[n]+1}
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Apr 10 2020

Formula

a(0) = 0, a(1) = 1, a(2) = 3, a(3) = 2,
if n > 3 and n even a(2*n) = 2*n + 1, a(2*n+1) = 2*a(n),
if n > 3 and n odd a(2*n) = 2*a(n) , a(2*n+1) = 2*a(n) + 1. - Yosu Yurramendi, Apr 10 2020

Extensions

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

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

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, 30, 31, 24, 25, 27, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 56, 57, 58, 59, 60, 61, 62, 63, 48, 49, 50, 51, 54, 55, 52, 53, 64, 65, 66, 67, 68, 69, 70, 71
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 inactive (fixing) state a 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, not starting before at the thirdmost significant bit), as long as the first zero is encountered, which is also complemented if its distance to the most significant bit is even, after which the remaining bits are left intact. E.g. 121 = 1111001 in binary. Complementing its thirdmost significant bit and the first zero-bit two positions right of it (i.e. bit-2, 4 steps to the most significant bit, bit-6), we obtain "11011.." after which the rest of the bits stay same, so we get 1101101, which is 109's binary representation, thus a(121)=109. On the other hand, 125 = 1111101 in binary and the transducer complements the bits at positions 4 and 2, yielding 11010.. and then switches to the fixing state at the zero encounted at bit-position 1, without complementing it (as it is 5 steps from the msb) and the rest are fixed, so we get 1101001, which is 105's binary representation, thus a(125)=105.
		

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: A154440. a(n) = A154445(A153142(n)) = A054429(A154443(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154441-A154448. Corresponds to A154449 in the group of Catalan bijections.

Extensions

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 17 2009

Keywords

Comments

This permutation of natural numbers is induced by the first 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 even distance from the most significant bit or B) the first 1-bit at odd distance from the most significant bit.

Examples

			25 = 11001 in binary, the first zero-bit at odd distance from the msb is immediately at where we start (at the second most significant bit), so we complement it and fix the rest, yielding 10001 (17 in binary), thus a(25)=17.
		

Crossrefs

Inverse: A154447. a(n) = A054429(A154447(A054429(n))). Cf. A072376, A153141-A153142, A154435-A154436, A154439-A154446. Corresponds to A154458 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+2)/3)
      a[2*x    ] <- 2*a[x] + 1
      a[2*x + 1] <- 2*a[x]
    }
    (a <- c(0, a))
    # Yosu Yurramendi, Oct 12 2020

Extensions

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

A153151 Rotated binary decrementing: For n<2 a(n) = n, if n=2^k, a(n) = 2*n-1, otherwise a(n) = n-1.

Original entry on oeis.org

0, 1, 3, 2, 7, 4, 5, 6, 15, 8, 9, 10, 11, 12, 13, 14, 31, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 63, 32, 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, 127, 64, 65, 66, 67, 68, 69
Offset: 0

Views

Author

Antti Karttunen, Dec 20 2008

Keywords

Comments

Without the initial 0, a(n) is the lexicographically minimal sequence of distinct positive integers such that all values of a(n) mod n are distinct and nonnegative. - Ivan Neretin, Apr 27 2015
A002487(n)/A002487(n+1), n > 0, runs through all the reduced nonnegative rationals exactly once. A002487 is the Stern's sequence. Permutation from denominators (A002487(n+1))
1 2 1 3 2 3 1 4 3 5 2 5 3 4 1
where labels are
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
to numerators (A002487(n))
1 1 2 1 3 2 3 1 4 3 5 2 5 3 4
where changed labels are
1 3 2 7 4 5 6 15 8 9 10 11 12 13 14
Thus, b(n) = A002487(n+1), b(a(n)) = A002487(n), n>0. - Yosu Yurramendi, Jul 07 2016

Crossrefs

Programs

  • Maple
    a := n -> if n < 2 then n elif convert(convert(n, base, 2), `+`) = 1 then 2*n-1 else n-1 fi: seq(a(n), n=0..70); # Peter Luschny, Jul 16 2016
  • Mathematica
    Table[Which[n < 2, n, IntegerQ[Log[2, n]], 2 n - 1, True, n - 1], {n, 0, 70}] (* Michael De Vlieger, Apr 27 2015 *)
  • Python
    def ok(n): return n&(n - 1)==0
    def a(n): return n if n<2 else 2*n - 1 if ok(n) else n - 1 # Indranil Ghosh, Jun 09 2017
    
  • R
    nmax <- 126 # by choice
    a <- c(1,3,2)
    for(n in 3:nmax) a[n+1] <- n
    for(m in 0:floor(log2(nmax))) a[2^m] <- 2^(m+1) - 1
    a <- c(0, a)
    # Yosu Yurramendi, Sep 05 2020

Formula

A153830 Index sequence to A089840: positions of bijections that preserve A127302 (the non-oriented form of binary trees) and whose behavior does not depend on whether there are internal or terminal nodes (leaves) in the neighborhood of any vertex.

Original entry on oeis.org

0, 1, 3, 7, 15, 21, 27, 46, 92, 114, 149, 169, 225, 251, 299, 400, 638, 753, 1233, 1348, 1705, 1823, 1992, 2097, 2335, 2451, 2995, 3128, 3485, 3607, 3677, 3771, 4214, 4307, 4631, 5254, 6692, 7393, 10287, 10988, 13145, 13860, 20353, 21054
Offset: 0

Views

Author

Antti Karttunen, Jan 07 2009

Keywords

Comments

These elements form a subgroup in A089840 (A089839) isomorphic to a group consisting of all finitely iterated wreath products of the form S_2 wr S_2 wr ... wr S_2 and each is an image of some finitary automorphism of an infinite binary tree. E.g. A089840(1) = *A069770 is an image of the generator A of Grigorchuk Group. See comments at A153246 and A153141.
The defining properties are propagated by all recursive transformations of A089840 which themselves do not behave differently depending whether there are internal or terminal vertices in the neighborhood of any vertex (at least the ones given in A122201-A122204, A122283-A122290, A130400-A130403), so this sequence gives also the corresponding positions in those tables.

Crossrefs

Showing 1-10 of 34 results. Next