A053626 a(n) is the smallest positive integer k such that harmonic mean of n and k is an integer.
1, 2, 3, 4, 5, 2, 7, 8, 9, 10, 11, 4, 13, 14, 3, 16, 17, 6, 19, 5, 21, 22, 23, 8, 25, 26, 27, 4, 29, 6, 31, 32, 33, 34, 14, 12, 37, 38, 39, 10, 41, 7, 43, 44, 5, 46, 47, 16, 49, 50, 51, 52, 53, 18, 55, 8, 57, 58, 59, 12, 61, 62, 18, 64, 65, 6, 67, 68, 69, 28, 71, 9, 73, 74, 15, 76
Offset: 1
Examples
a(6) = 2 because harmonic mean of 6 and 2 is 3 which is an integer and harmonic mean of 6 and 1 is 12/7 which is not an integer.
Links
- Altug Alkan, Table of n, a(n) for n = 1..10000
- Wikipedia, Harmonic mean -- Two numbers
Crossrefs
Cf. A005279.
Programs
-
Mathematica
Array[If[Count[Partition[Divisors[#], 2, 1], ?(#2 < 2 #1 & @@ # &)] == 0, #, Block[{k = 1}, While[! IntegerQ@ HarmonicMean@{k, #}, k++]; k]] &, 76] (* _Michael De Vlieger, Apr 05 2018 *)
-
PARI
a(n) = {my(k=1); while((2*n*k) % (n+k) != 0, k++); k; } \\ Altug Alkan, Mar 29 2018
Extensions
Name edited by Altug Alkan, Mar 29 2018
Comments