|
|
A178412
|
|
a(n) is defined recursively as the Sum{d|n} ((-1)^(n/d))*a(d) = 1, with a(1) = a(2) = 1.
|
|
1
|
|
|
1, 1, -2, 1, -2, -3, -2, 2, 0, -3, -2, -5, -2, -3, 2, 4, -2, 0, -2, -5, 2, -3, -2, -10, 0, -3, 0, -5, -2, 3, -2, 8, 2, -3, 2, 0, -2, -3, 2, -10, -2, 3, -2, -5, 0, -3, -2, -20, 0, 0, 2, -5, -2, 0, 2, -10, 2, -3, -2, 5, -2, -3, 0, 16, 2, 3, -2, -5, 2, 3, -2, 0, -2, -3, 0, -5, 2, 3, -2, -20, 0, -3, -2, 5, 2, -3, 2, -10, -2, 0, 2, -5, 2, -3, 2, -40, -2, 0, 0, 0, -2, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
If n>=3 is odd squarefree (A056911), then a(n)=2; if n>=6 is even squarefree (A039956), then a(n)=3; if n>=4 has the form (2^k)*m, where k>=2 and m is odd squarefree, then a(n)=n/4 in case of m=1 and a(n)=5*2^(k-2) in case of m>1; if an odd square divides n, then a(n)=0. A generalization. Let A(n)=|B(n)|, where B(1)=f, B(2)=g and, for n>=3, B(n)is defined by the recursion: Sum{d|n}((-1)^(n/d))*B(d)=h. Then we have:if n>=3 is odd squarefree,then A(n)=f+h; if n>=6 is even squarefree,then A(n)=g+2*h; if n>=4 has the form (2^k)*m, where k>=2 and m is odd squarefree, then A(n)=n/4 in case of m=1 and A(n)=(f+g+3*h)*2^(k-2) in case of m>1; if an odd square divides n, then A(n)=0.
|
|
EXAMPLE
|
For n=3, we have Sum{d=1,3}((-1)^(3/d))*b(d)=-1-b(3)=1. Thus b(3)-2 and a(3)=2.
|
|
MATHEMATICA
|
a[1] = a[2] = 1; a[n_] := a[n] = Block[{d = Most@ Divisors@ n}, -1 + Plus @@ (((-1)^(n/#)) a[ # ] & /@ d)]; Array[a, 102] (* Robert G. Wilson v, Aug 26 2010 *)
|
|
PROG
|
(PARI)
up_to = 65537;
A178412list(up_to) = { my(u=vector(up_to)); u[1] = u[2] = 1; for(n=3, up_to, u[n] = sumdiv(n, d, if(d<n, ((-1)^(n/d))*u[d]))-1); (u); };
v178412 = A178412list(up_to);
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|