OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
M * V where M = A126988 as an infinite lower triangular matrix and V = the Mertens sequence, A002321 as a vector: [1, 0, -1, -1, -2, -1, ...].
a(n) = Sum_{q=1..n} c_q(n), where c_q(n) is the Ramanujan's sum function given in A054533. - Daniel Suteu, Jun 14 2018
EXAMPLE
a(6) = 3 = 6*1 + 3*0 + 2*(-1) + 0*(-1) + 0*(-2) + 1*(-1), where (6, 3, 2, 0, 0, 1) = row 6 of A126988.
MATHEMATICA
Block[{nn = 70, m}, m = Table[Sum[MoebiusMu@k, {k, n}], {n, nn}]; Table[Total@ Array[m[[#]] If[Mod[n, #] == 0, n/#, 0] &, n], {n, nn}]] (* Michael De Vlieger, Jun 14 2018 *)
PROG
(PARI) lista(nn) = {mat = matrix(nn, nn, n, k, if (n % k, 0, n/k)); vec = matrix(nn, 1, n, k, if (k==1, mertens(n), 0)); res = (mat*vec); for (n = 1, nn, print1(res[n, 1], ", "); ); } \\ Michel Marcus, Sep 25 2013
(PARI) a(n) = sum(k=1, n, moebius(k / gcd(n, k)) * eulerphi(k) / eulerphi(k / gcd(n, k))); \\ Daniel Suteu, Jun 23 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Gary W. Adamson, Jan 10 2007
EXTENSIONS
Corrected and extended by Michel Marcus, Sep 25 2013
STATUS
approved