OFFSET
1,3
COMMENTS
The reduced residue system modulo n used here is the set of numbers k from the set {0,1,...,n-1} which satisfy gcd(k,n)=1. There are phi(n) = A000010(n) such numbers k. Cf. A038566. See also the Apostol reference p. 133, and the Wikipedia link.
This is the m=3 member of a family of sequences, call them rmnS(m) (reduced mod n sum), with entries rmnS(m;n):=sum(binomial(k+m-1,m),0<=k<=n-1 with gcd(k,n)=1), m>=0, n>=1. Recall gcd(0,n)=n.
REFERENCES
T. Apostol, Introduction to Analytic Number Theory, Springer, 1986.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Wikipedia, Reduced residue system
FORMULA
EXAMPLE
MAPLE
A000292 := proc(n) binomial(n+2, 3) ; end proc:
A189918 := proc(n) local a; a := 0 ; for k from 0 to n-1 do if igcd(k, n) = 1 then a := a+A000292(k); end if; end do: a ; end proc:
seq(A189918(n), n=1..40) ; # R. J. Mathar, Jun 13 2011
MATHEMATICA
a[n_] := Sum[ Boole[GCD[k, n] == 1]*k*(k+1)*(k+2)/6, {k, 0, n-1}]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jul 12 2012 *)
PROG
(PARI) a(n) = sum(k=0, n-1, if (gcd(n, k)==1, k*(k+1)*(k+2)/6)); \\ Michel Marcus, Feb 01 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Wolfdieter Lang, May 19 2011
STATUS
approved