OFFSET
1,8
COMMENTS
The partial sum a(1)+a(2)+...+a(n) is asymptotic to -sqrt(2n).
The Liouville lambda function satisfies: Sum_{k=1..n} lambda(k)*floor(n/k) = floor(n^(1/2)), that's why this sequence is "almost" a Liouville function.
REFERENCES
B. Cloitre, Almost Liouville functions, in preparation, 2011.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
Sum_{k=1..n} a(k)*g(n/k) = floor(n^(1/2)) where g(x) = 2^floor(log(x)/log(2)) for n>1 with a(1)=1.
a(1) = 1; for n > 1, a(n) = A000196(n) - Sum{k=1 .. n-1} a(k)*A053644(floor(n/k)). - Antti Karttunen, Sep 28 2018
PROG
(PARI) {a(n)=if(n==1, 1, floor(n^(1/2))-sum(k=1, n-1, a(k)*2^floor(log(n/k)/log(2))))}
(PARI)
up_to = 2048;
A000196(n) = sqrtint(n);
A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644. Note that we are calling this here also with rational arguments, but it works all fine.
A181563list(up_to) = { my(v=vector(up_to)); v[1] = 1; for(n=2, up_to, v[n] = A000196(n) - sum(k=1, n-1, v[k]*A053644(n/k))); (v); };
v181563 = A181563list(up_to);
A181563(n) = v181563[n]; \\ Antti Karttunen, Sep 28 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Benoit Cloitre, Jan 29 2011
STATUS
approved