cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A124440 a(n) = Sum_{n/2<=k<=n, gcd(k,n)=1} k.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Nov 01 2006

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • PARI
    a(n) = sum(k=ceil(n/2), n, if (gcd(n, k)==1, k)); \\ Michel Marcus, Feb 03 2021

Formula

For n > 2, a(n) = phi(n)*n/2 - A066840(n).

Extensions

Extended by Ray Chandler, Nov 12 2006