OFFSET
1,4
COMMENTS
a(1) and a(2) are the only negative terms of the sequence.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The positive integers which are <= 10 and are coprime to 10 are 1,3,7,9. So a(10) = -1 + 3 - 7 + 9 = 4.
MAPLE
with(numtheory): t:=proc(k, n) local A, i: A:={}: for i from 1 while nops(A)<=k do if igcd(i, n)=1 then A:=A union {i} else A:=A: fi od: A[k] end: a:=n->add((-1)^k*t(k, n), k=1..phi(n)): seq(a(n), n=1..100); # Emeric Deutsch, May 06 2007
MATHEMATICA
Table[Total[Times@@@Partition[Riffle[Select[Range[n], CoprimeQ[#, n]&], {-1, 1}, {2, -1, 2}], 2]], {n, 100}] (* Harvey P. Dale, May 05 2013 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Leroy Quet, May 03 2007
EXTENSIONS
More terms from Emeric Deutsch, May 06 2007
STATUS
approved