login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A124440
a(n) = Sum_{n/2<=k<=n, gcd(k,n)=1} k.
7
1, 1, 2, 3, 7, 5, 15, 12, 20, 16, 40, 18, 57, 33, 46, 48, 100, 41, 126, 60, 96, 85, 187, 72, 187, 120, 182, 126, 301, 88, 345, 192, 250, 208, 318, 162, 495, 261, 354, 240, 610, 186, 672, 330, 406, 385, 805, 288, 771, 376, 616, 468, 1027, 365, 830, 504, 774, 616, 1276
OFFSET
1,3
LINKS
FORMULA
For n > 2, a(n) = phi(n)*n/2 - A066840(n).
EXAMPLE
The integers which are >= 10/2 and are <= 10 and which are coprime to 10 are 7 and 9. So a(10) = 7 + 9 = 16.
MAPLE
N:= 100: # for a(1)..a(N)
G:= add(numtheory:-mobius(n)*n*x^(2*n)/((1-x^n)*(1-x^(2*n))^2), n=1..N/2):
S:= series(G, x, N+1):
A66840:= [seq(coeff(S, x, j), j=1..N)]:
f:= proc(n) n*numtheory:-phi(n)/2 - A66840[n] end proc:
f(1):= 1: f(2):= 1:
map(f, [$1..N]); # Robert Israel, Feb 02 2021
MATHEMATICA
a[n_] := Plus @@ Select[Range[Ceiling[n/2], n], GCD[ #, n] == 1 &]; Table[a[n], {n, 60}] (* Ray Chandler, Nov 12 2006 *)
PROG
(PARI) a(n) = sum(k=ceil(n/2), n, if (gcd(n, k)==1, k)); \\ Michel Marcus, Feb 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 01 2006
EXTENSIONS
Extended by Ray Chandler, Nov 12 2006
STATUS
approved