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.
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
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.
Links
- A. Karttunen, Table of n, a(n) for n = 0..2047
- Bondarenko, Grigorchuk, Kravchenko, Muntyan, Nekrashevych, Savchuk, Sunic, Classification of groups generated by 3-state automata over a 2-letter alphabet, arXiv:0803.3555 [math.GR], 2008, p. 144.
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
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
Comments