OFFSET
0,3
LINKS
FORMULA
a(1) = 1, a(2^(m+1)+2*k) = 2*a(2^(m+1)-1-k), a(2^(m+1)+2*k+1) = 2*a(2^m+k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Jan 25 2020
PROG
(R)
a <- 1
maxlevel <- 5 # by choice
#
for(m in 0:maxlevel) for(k in 0:(2^m-1)){
a[2^(m+1)+2*k ] <- 2*a[2^(m+1)-1-k] + 1
a[2^(m+1)+2*k+1] <- 2*a[2^m+k]
}
a <- c(0, a)
# Yosu Yurramendi, Jan 25 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 20 2008
STATUS
approved