# determining integer contraharmonic means

For determining effectively values $c$ of integer contraharmonic means of two positive integers $u$ and $v$ ($1\,<\,u\,<\,v$), it’s convenient to start from the (7) in the parent entry (http://planetmath.org/IntegerContraharmonicMeans):

 $\displaystyle v\;=\;\frac{2u^{2}}{w}\!-\!u$ (1)

where $w$ is any positive factor of $2u^{2}$ less than $u$.  Substituting the above expression of $v$ to the defining expression

 $c\;=\;\frac{u^{2}\!+\!v^{2}}{u\!+\!v}$

of $c$, this gets the form

 $\displaystyle c\;=\;\frac{2u^{2}}{w}\!-\!2u\!+\!w.$ (2)

Hence one can use the formulae (1) and (2), giving in them for each desired $u$ the values $w$ of the positive factors of $2u^{2}$, beginning from  $w:=1$  and stopping before  $w=u$.

 $\displaystyle h\;=\;2u\!-\!w.$ (3)

Example.  In the following table one sees for  $u=36$  all possible values of the parametre $w$ and the corresponding values of $c$ and $h$; the pertinent values of $v$ are given, too.

 $w$ $v$ $c$ $h$ $1$ $2$ $3$ $4$ $6$ $8$ $9$ $12$ $16$ $18$ $24$ $27$ $32$ $2556$ $1260$ $828$ $612$ $396$ $288$ $252$ $180$ $126$ $108$ $72$ $60$ $45$ $2521$ $1226$ $795$ $580$ $366$ $260$ $225$ $156$ $106$ $90$ $60$ $51$ $41$ $71$ $70$ $69$ $68$ $66$ $64$ $63$ $60$ $56$ $54$ $48$ $45$ $40$

As one sees, the contraharmonic and the harmonic mean may differ considerably, but also the difference 1 is possible.

## References

Title determining integer contraharmonic means DeterminingIntegerContraharmonicMeans 2013-11-19 18:13:25 2013-11-19 18:13:25 pahio (2872) pahio (2872) 15 pahio (2872) Algorithm msc 11Z05 msc 11A05 msc 11D09 msc 11D45 LinearFormulasForPythagoreanTriples