|
|
A233280
|
|
Permutation of nonnegative integers: a(n) = A003188(A054429(n)).
|
|
10
|
|
|
0, 1, 2, 3, 4, 5, 7, 6, 8, 9, 11, 10, 14, 15, 13, 12, 16, 17, 19, 18, 22, 23, 21, 20, 28, 29, 31, 30, 26, 27, 25, 24, 32, 33, 35, 34, 38, 39, 37, 36, 44, 45, 47, 46, 42, 43, 41, 40, 56, 57, 59, 58, 62, 63, 61, 60, 52, 53, 55, 54, 50, 51, 49, 48, 64, 65, 67, 66
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(0)=0, a(1)=1, and otherwise, a(2n) = A000069(1+a(n)), a(2n+1) = A001969(1+a(n)). [A recurrence based on entangling even & odd numbers with odious and evil numbers]
|
|
PROG
|
(Scheme)
;; Alternative version, based on entangling even & odd numbers with odious and evil numbers:
(R)
maxrow <- 8 # by choice
a <- 1
for(m in 0:maxrow) for(k in 0:(2^m-1)){
a[2^(m+1)+ k] <- a[2^m+ k] + 2^m
a[2^(m+1)+2^m+k] <- a[2^(m+1)-1-k] + 2^(m+1)
}
a
(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 a003188(a054429(n)) # Indranil Ghosh, Jun 11 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|