OFFSET
1,2
COMMENTS
For values of n such that a(n) = n, see A113570; this begins: 1, 2, 4, 8, 9, 16, 27, 32, 64, 81, ...
Conjecture: a(n) <= n for all positive n's.
LINKS
Michel Marcus, Table of n, a(n) for n = 1..1000
EXAMPLE
a(5) = 4 because H(4) = 25/12 is the first harmonic number with either its numerator or denominator divisible by 5.
a(6) = 3 because H(3) = 11/6 is the first harmonic number with either its numerator or denominator divisible by 6.
MATHEMATICA
f[n_] := Block[{h = k = 1}, While[ !IntegerQ[ Numerator[h]/n] && !IntegerQ[ Denominator[h]/n], k++; h = h + 1/k]; k]; Table[ f[n], {n, 81}] (* Robert G. Wilson v, Sep 28 2005 *)
PROG
(PARI) isok(h, n) = ((numerator(h) % n) == 0) || ((denominator(h) % n) == 0);
h(n) = sum(k=1, n, 1/k);
a(n) = {my(k = 1); while(! isok(h(k), n), k++); k; } \\ Michel Marcus, Jul 23 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 11 2005
EXTENSIONS
More terms from Robert G. Wilson v, Sep 28 2005
STATUS
approved