login
A304576
a(n) = Sum_{k < n, k squarefree and relatively prime to n} (-1)^(k-1).
3
1, 1, 0, 2, 1, 2, 1, 4, 2, 3, 1, 4, 2, 5, 2, 7, 3, 6, 4, 7, 4, 9, 5, 8, 5, 10, 3, 9, 5, 8, 5, 13, 5, 13, 5, 11, 7, 15, 5, 14, 8, 11, 8, 17, 6, 18, 8, 15, 8, 17, 7, 19, 10, 16, 9, 20, 9, 23, 12, 15, 13, 25, 8, 26, 10, 18, 13, 26, 11, 22, 14, 22, 15, 30, 9, 29
OFFSET
1,4
MATHEMATICA
l[n_]:=Sum[(-1)^(k-1), {k, Select[Range[n], And[SquareFreeQ[#], GCD[n, #]==1]&]}];
Table[l[n], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, n, if (issquarefree(k) && (gcd(n, k)==1), (-1)^(k-1))); \\ Michel Marcus, May 15 2018
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 14 2018
STATUS
approved