A284447 Permutation of the positive integers: a(n) = A258996(A092569(n)) = A092569(A258996(n)).
1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 8, 9, 10, 11, 20, 21, 22, 23, 16, 17, 18, 19, 28, 29, 30, 31, 24, 25, 26, 27, 52, 53, 54, 55, 48, 49, 50, 51, 60, 61, 62, 63, 56, 57, 58, 59, 36, 37, 38, 39, 32, 33, 34, 35, 44, 45, 46, 47, 40, 41, 42, 43
Offset: 1
Keywords
Links
- Yosu Yurramendi, Table of n, a(n) for n = 1..32767
Programs
-
R
maxrow <- 8 # by choice a <- 1:3 for(m in 1:maxrow) for(k in 0:(2^m-1)){ if(m%%2 == 1){a[2^(m+1)+ k] <- a[2^m+k] + 2^m a[2^(m+1)+2^m+k] <- a[2^m+k] + 2^(m+1)} else {a[2^(m+1)+ k] <- a[2^m+k] + 2^(m+1) a[2^(m+1)+2^m+k] <- a[2^m+k] + 2^m} } a # Yosu Yurramendi, Apr 06 2017
-
R
# Given n, compute a(n) by taking into account the binary representation of n maxblock <- 7 # by choice a <- 1:7 for(n in 8:2^maxblock){ ones <- which(as.integer(intToBits(n)) == 1) nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)] anbit <- nbit anbit[seq(3, length(anbit) - 1, 2)] <- 1 - anbit[seq(3, length(anbit) - 1, 2)] a <- c(a, sum(anbit*2^(0:(length(anbit) - 1)))) } a # Yosu Yurramendi, Mar 30 2021
Comments