OFFSET
0,5
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8191
FORMULA
a(n) is odd iff n is a power of 2.
a(n) = 0 iff n = 2^k with k = 0 or k = 2.
a(2^k) = 3^(k-1) for any k > 0.
a(2^k+1) = A056182(k-1) for any k > 1.
EXAMPLE
a(2) = a(2 AND 0) + a(1 AND 1) + a(0 AND 2) = a(0) + a(1) + a(0) = 1.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
add(a(Bits[And](n-k, k)), k=0..n))
end:
seq(a(n), n=0..80); # Alois P. Heinz, Oct 20 2019
PROG
(PARI) a = vector(61); for (n=0, #a-1, print1 (a[1+n] = if (n==0, 0, n==1, 1, sum (k=0, n, a[1+bitand(n-k, k)])) ", "))
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Oct 20 2019
STATUS
approved