integer contraharmonic means

Let u and v be positive integers.  There exist nontrivial cases where their contraharmonic mean

c:=u2+v2u+v (1)

is an integer, too.  For example, the values  u=3,v=15  have the contraharmonic mean  c=13.  The only “trivial cases” are those with  u=v,  when  c=u=v.

u 2 3 3 4 4 5 5 6 6 6 6 7 7 8 8 8 9 9
v 6 6 15 12 28 20 45 12 18 30 66 42 91 24 56 120 18 45
c 5 5 13 10 25 17 41 10 15 26 61 37 85 20 50 113 15 39

The nontrivial integer contraharmonic means form Sloane’s sequenceMathworldPlanetmath

PropositionPlanetmathPlanetmath 1.  For any value of u>2, there are at least two greater values of v such that  c.

Proof.  One has the identities

u2+((u-1)u)2u+(u-1)u=u2-2u+2, (2)
u2+((2u-1)u)2u+(2u-1)u= 2u2-2u+1, (3)

the right hand sides of which are positive integers and different for  u1.  The value  u=2  is an exception, since it has only  v=6  with which its contraharmonic mean is an integer.

In (2) and (3), the value of v is a multipleMathworldPlanetmath of u, but it needs not be always so in to c be an integer, e.g. we have  u=12,v=20,c=17.

Proposition 2.  For all  u>1, a necessary condition for c  is that


Proof.  Suppose that we have positive integers u,v such that  gcd(u,v)=1.  Then as well,  gcd(u+v,uv)=1,  since otherwise both u+v and uv would be divisible by a prime p, and thus also one of the factors ( u and v of uv would be divisible by p; then however  pu+v would imply that  pu  and  pv, whence we would have  gcd(u,v)p.  Consequently, we must have  gcd(u+v,uv)=1.

We make the additional supposition that u2+v2u+v is an integer, i.e. that


is divisible by u+v.  Therefore also 2uv is divisible by this sum.  But because  gcd(u+v,uv)=1, the factor 2 must be divisible by u+v, which is at least 2.  Thus  u=v=1.

The conclusionMathworldPlanetmath is, that only the “most trivial case”  u=v=1  allows that  gcd(u,v)=1.  This settles the proof.

Proposition 3.  If u is an odd prime number, then (2) and (3) are the only possibilities enabling integer contraharmonic means.

Proof.  Let u be a positive odd prime.  The values  v=(u-1)u  and  v=(2u-1)u  do always.  As for other possible values of v, according to the Proposition 2, they must be multiples of the prime numberMathworldPlanetmath u:




and since u is prime, either  un+1  or  n+1n2+1.

In the former case  n+1=ku,  one obtains


which is an integer only for  k=1  and  k=2, corresponding (2) and (3).

In the latter case, there must be a prime number p dividing both n+1 and n2+1, whence  pn.  The equation


then implies that  p2n.  So we must have  p2,  i.e. necessarily  p=2.  Moreover, if we had  4n+1  and  4n2+1,  then we could write  n+1=4m,  and thus

n2+1=(4m-1)2+1= 16m2-8m+20(mod4),

which is impossible.  We infer, that now  gcd(n+1,n2+1)=2,  and in any case

gcd(n+1,n2+1) 2.

Nevertheless, since  n+13  and  n+1n2+1,  we should have  gcd(n+1,n2+1)3.  The contradictionMathworldPlanetmathPlanetmath means that the latter case is not possible, and the Proposition 3 has been proved.

Proposition 4.  If  (u1,v,c)  is a nontrivial solution of (1) with  u1<c<v,  then there is always another nontrivial solution  (u2,v,c)  with  u2<v.  On the contrary, if  (u,v1,c)  is a nontrivial solution of (1) with  u<c<v1,  there exists no different solution  (u,v2,c).

For example, there are the solutions  (2, 6, 5)  and  (3, 6, 5);  (5, 20, 17)  and  (12, 20, 17).

Proof.  The Diophantine equationMathworldPlanetmath (1) may be written

u2-cu+(v2-cv)= 0, (4)


u=c±c2+4cv-4v22, (5)

and the discriminantPlanetmathPlanetmath of (4) must be nonnogative because of the existence of the real root ( u1.  But if it were zero, i.e. if the equation  c2+4cv-4v2=0  were true, this would imply for v the irrational value 12(1+2)c.  Thus the discriminant must be positive, and then also the smaller root u of (4) gotten with “-” in front of the square root is positive, since we can rewrite it


and the numerator is positive because  v>c.  Thus, when the discriminant of the equation (4) is positive, the equation has always two distinct positive roots u.  When one of the roots (u1) is an integer, the other is an integer, too, because in the numerator of (5) the sum and the differencePlanetmathPlanetmath of two integers are simultaneously even.  It follows the existence of u2, distinct from u1.

If one solves (1) for v, the smaller root


is negative.  Thus there cannot be any  (u,v2,c).

Proposition 5.  When the contraharmonic mean of two different positive integers u and v is an integer, their sum is never squarefreeMathworldPlanetmath.

Proof.  By Proposition 2 we have

gcd(u,v)=:d> 1.



when  gcd(u,v)= 1.  Then

c=(u 2+v 2)du+v,


(u+v)c=(u 2+v 2)d[(u+v)2-2uv]d. (6)

If p is any odd prime factor of u+v, the last equation implies that


and consequently  pd.  Thus we see that


This means that the sum u+v is not squarefree.  The same result is easily got also in the case that u and v both are even.

Note 1.  Cf.  u+v=c+b  in 2 of the proof of this theorem ( and the Note 4 of entry.

Proposition 6.  For each integer  u>0  there are only a finite number of solutions  (u,v,c)  of the Diophantine equation (1).  The number does not exceed u-1.

Proof.  The expression of the contraharmonic mean in (1) may be edited as follows:


In to c be an integer, the quotient


must be integer; rewriting this last equation as

v=2u2w-u (7)

we infer that w has to be a of 2u2 (apparently  1w<u  for getting values of v greater than u).  The amount of such divisors is quite restricted, not more than u-1, and consequently there is only a finite number of suitable values of v.

Note 2.  The equation (7) explains the result of Proposition 1 (w=1,  w=2).  As well, if u is an odd prime number, then the only factors of 2u2 less than u are 1 and 2, and for these the equation (7) gives the values  v:=(2u-1)u  and  v:=(u-1)u  which explains Proposition 3.


  • 1 J. Pahikkala: “On contraharmonic mean and Pythagorean triplesMathworldPlanetmath”.  – Elemente der Mathematik 65:2 (2010).
Title integer contraharmonic means
Canonical name IntegerContraharmonicMeans
Date of creation 2013-12-04 10:25:44
Last modified on 2013-12-04 10:25:44
Owner pahio (2872)
Last modified by pahio (2872)
Numerical id 45
Author pahio (2872)
Entry type Topic
Classification msc 11Z05
Classification msc 11D45
Classification msc 11D09
Classification msc 11A05
Synonym integer contraharmonic means of integers
Related topic ComparisonOfPythagoreanMeans
Related topic DivisibilityInRings
Related topic Gcd
Defines contraharmonic integerPlanetmathPlanetmath