OFFSET
1,2
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Wikipedia, Contraharmonic mean.
FORMULA
a(n) = (3*A179882(n) - 1)/2. - Hilko Koning, Aug 01 2018
a(n) = A179878(n) - 1. - Amiram Eldar, May 24 2025
EXAMPLE
From Michael De Vlieger, Jul 30 2018: (Start)
10 is in the sequence since the reduced residue system of 10 is {1, 3, 7, 9} and that of 11 is {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, the mean of the squares of these 2 systems, divided by the mean of the systems themselves, is 7 in both cases.
6 is not in the sequence, because though the RRS of 6, {1, 5}, and that of 7, {1, 2, 3, 4, 5, 6}, have the same contraharmonic mean of 13/3, it is not integral. (End) [corrected by Hilko Koning, Aug 20 2018]
MATHEMATICA
With[{s = Partition[Table[Mean[#^2]/Mean[#] &@ Select[Range[n - 1], GCD[#, n] == 1 &], {n, 1400}], 2, 1]}, Position[s, _?(And[IntegerQ@ First@ #, SameQ @@ #] &), 1, Heads -> False][[All, 1]]]
PROG
(PARI) ah(n) = {my(f = factor(n)); if(n == 1, 1, 2*n/3 + (1/3) * prod(i = 1, #f~, 1 - f[i, 1])/eulerphi(f)); }
isok(k) = {my(ah1 = ah(k), ah2 = ah(k+1)); ah1 == ah2 && denominator(ah1) == 1; } \\ Amiram Eldar, May 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Jul 30 2010, Jul 31 2010
EXTENSIONS
More terms from Michael De Vlieger, Jul 30 2018
STATUS
approved
