OFFSET
0,3
COMMENTS
LINKS
FORMULA
PROG
(Scheme)
;; Alternative version, based on entangling even & odd numbers with odious and evil numbers:
(definec (A233280 n) (cond ((< n 2) n) ((even? n) (A000069 (+ 1 (A233280 (/ n 2))))) (else (A001969 (+ 1 (A233280 (/ (- n 1) 2)))))))
(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
# Yosu Yurramendi, Apr 05 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 a003188(a054429(n)) # Indranil Ghosh, Jun 11 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 18 2013
STATUS
approved