# A023896 oddities

hv at crypt.org hv at crypt.org
Sun Feb 20 15:43:22 CET 2005

```In the EIS entry for this sequence, the %S and %N lines both show a(1) = 1,
but the formulae all specify a(1) = 0 (equivalent to replacing "1<=k<=n"
with "1<=k<n" in the %C). Note that without specifying the exception, the
formula would give a(1)=1/2, but following the same convention as for phi(n)
(ie counting 1<=k<=n) taking a(1)=1 makes sense. Modified lines:

%F A023896 a(n)=n*phi(n)/2 if n>1, a(1)=1.
%F A023896 a(n) = Sum{1 <= k <= n, k for GCD(k,n) =1}.
%t A023896 a[ n_ ]=n/2*EulerPhi[ n ]; a[ 1 ]=1.
%o A023896 (PARI) a(n)=if(n<2,1,n*eulerphi(n)/2)

giving:

%I A023896
%S A023896 1,1,3,4,10,6,21,16,27,20,55,24,78,42,60,64,136,54,171,80,126,110,253,
%T A023896 96,250,156,243,168,406,120,465,256,330,272,420,216,666,342,468,320,
%U A023896 820,252,903,440,540,506,1081,384,1029,500,816,624,1378,486,1100,672
%N A023896 Sum of positive integers in reduced residue system modulo n. a(1) = 1 by convention.
%C A023896 a(n) = Sum_{1<=k<=n, GCD(k,n)=1} k.
%D A023896 T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 16, the function phi_1(n).
%D A023896 D. M. Burton, Elementary Number Theory, p. 171.
%D A023896 Tattersall, J. "Elementary Number Theory in Nine Chapters", Cambridge University Press, 2001, p. 163.
%F A023896 a(n)=n*phi(n)/2 if n>1, a(1)=1.
%F A023896 a(n) = Sum{1 <= k <= n, k for GCD(k,n) =1}.
%F A023896 If n = p is a prime, a(p)=T(p-1) where T(k) is the k-th triangular number (A000217). - Robert G. Wilson v, Jul 31 2004
%e A023896 a(12) = 1 + 5 + 7 + 11 = 24.
%e A023896 Reduced residue system for 40 = {1,3,7,9,11,13,17,19,21,23,27,29,31,33,37,39}. The sum is 320. Average is 20
%t A023896 a[ n_ ]=n/2*EulerPhi[ n ]; a[ 1 ]=1.
%o A023896 (PARI) a(n)=if(n<2,1,n*eulerphi(n)/2)
%Y A023896 Cf. A000010, A000203, A002180, A045545, A001783, A024816, A066760.
%Y A023896 Adjacent sequences: A023893 A023894 A023895 this_sequence A023897 A023898 A023899
%Y A023896 Sequence in context: A032477 A063930 A014411 this_sequence A075100 A066861 A047341
%K A023896 nonn,easy,nice
%O A023896 1,3
%A A023896 Olivier Gerard (ogerard(AT)ext.jussieu.fr)

Hugo

```