OFFSET
1,2
COMMENTS
Sum of 1 <= m <= n such that gcd(m, n) is either 1 or m. - Michael De Vlieger, Apr 07 2021.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
n=10: related terms = {1,2,5,10,3,7,9}, sum = 1+2+5+10+1+3+7+9-1 = 37 = a(10).
MATHEMATICA
Table[DivisorSigma[1, n] + Total@ Select[Range[2, n - 1], GCD[n, #] == 1 &], {n, 55}] (* or *)
{1}~Join~Array[DivisorSigma[1, #] + # EulerPhi[#]/2 - 1 &, 54, 2] (* Michael De Vlieger, Apr 07 2021 *)
PROG
(PARI) a(n)=if(n>1, sigma(n)+n*eulerphi(n)/2-1, 1) \\ Charles R Greathouse IV, Feb 19 2013
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Labos Elemer, May 13 2003
STATUS
approved