OFFSET
0,2
LINKS
FORMULA
PROG
(define (A001477bi x y) (/ (+ (expt (+ x y) 2) x (* 3 y)) 2))
(Python)
def A(x, y): return (((x + y)**2) + x + 3*y)//2
def a006068(n):
s=1
while True:
ns=n>>s
if ns==0: break
n=n^ns
s<<=1
return n
def a059905(n): return sum([(n>>2*i&1)<<i for i in range(int(len(bin(n)[2:])//2) + 1)])
def a059906(n):
x=[int(k) for k in list(bin(n)[2:])][::-1]
return sum([x[2*i + 1]*2**i for i in range(len(x)//2)])
def a(n): return A(a006068(a059906(n)), a006068(a059905(n)))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 25 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 29 2009
STATUS
approved