login
A365714
Sum of reversing binary value of n (A065620) and its Dirichlet inverse.
3
2, 0, 0, 4, 0, -4, 0, 8, 1, -12, 0, -4, 0, 12, 6, 16, 0, -30, 0, -12, -6, 28, 0, -8, 9, 20, 15, 12, 0, -32, 0, 32, -14, -60, -18, -28, 0, 60, -10, -24, 0, 64, 0, 28, 61, -52, 0, -16, 9, 18, 30, 20, 0, -66, -42, 24, -30, -44, 0, -20, 0, 44, -77, 64, -30, -96, 0, -60, 26, 160, 0, -56, 0, 116, 39, 60, 42, -96, 0, -48, 89
OFFSET
1,1
LINKS
FORMULA
a(n) = A065620(n) + A365713(n).
a(1) = 2, and for n > 1, a(n) = -Sum_{d|n, 1<d<n} A065620(d) * A365713(n/d).
a(4*n)/4 = A065620(n).
PROG
(PARI)
A065620(n, c=1) = sum(i=0, logint(n+!n, 2), if(bittest(n, i), (-1)^c++<<i)); \\ From A065620 by M. F. Hasler
memoA365713 = Map();
A365713(n) = if(1==n, 1, my(v); if(mapisdefined(memoA365713, n, &v), v, v = -sumdiv(n, d, if(d<n, A065620(n/d)*A365713(d), 0)); mapput(memoA365713, n, v); (v)));
A365714(n) = (A065620(n)+A365713(n));
CROSSREFS
Cf. also A365712.
Sequence in context: A307510 A323885 A137513 * A221419 A140668 A353369
KEYWORD
sign
AUTHOR
Antti Karttunen, Sep 19 2023
STATUS
approved