OFFSET
1,2
COMMENTS
Dirichlet inverse of A006530.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
Eric Weisstein's World of Mathematics, Greatest Prime Factor
FORMULA
From Bernard Schott, Dec 05 2021: (Start)
a(n) = -n iff n is prime.
a(2^k) = (-1)^k * 2 for k > 0. (End)
MATHEMATICA
a[1] = 1; a[n_] := a[n] = -Sum[(FactorInteger[n/d][[-1, 1]]) a[d], {d, Most @ Divisors[n]}]; Table[a[n], {n, 1, 60}]
PROG
(PARI)
A006530(n) = if(1==n, n, my(f=factor(n)); f[#f~, 1]);
memoA349789 = Map();
A349789(n) = if(1==n, 1, my(v); if(mapisdefined(memoA349789, n, &v), v, v = -sumdiv(n, d, if(d<n, A006530(n/d)*A349789(d), 0)); mapput(memoA349789, n, v); (v))); \\ Antti Karttunen, Dec 05 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Nov 30 2021
STATUS
approved