OFFSET
1,2
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..16384
Robert G. Wilson v, Plot of first 4096 terms
FORMULA
Sum of reciprocals of k-th "chunk" (between two entries k) = 1 (for example for the third chunk, 1/3 + 1/6 + 1/6 + 1/3 = 1).
MAPLE
b:= proc(n) option remember; `if`(n<2, n,
(q-> b(q)+(n-2*q)*b(n-q))(iquo(n, 2)))
end:
a:= n-> b(n)*b(n+1):
seq(a(n), n=1..100); # Alois P. Heinz, Feb 11 2021
MATHEMATICA
a[0] = 1; a[n_] := If[ OddQ[n], a[n/2 - 1/2], a[n/2] + a[n/2 - 1]]; Table[ a[n - 1]*a[n], {n, 1, 70}]
PROG
(Python)
def a002487(n): return n if n<2 else a002487(n/2) if n%2==0 else a002487((n - 1)/2) + a002487((n + 1)/2)
def a(n): return a002487(n)*a002487(n + 1) # Indranil Ghosh, Jun 08 2017
(Python)
from functools import reduce
def A070871(n): return sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n)[-1:2:-1], (1, 0)))*sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n+1)[-1:2:-1], (1, 0))) # Chai Wah Wu, May 05 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 19 2002
STATUS
approved