OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n = 1..100
R. Mestrovic, Wolstenholme's theorem: Its Generalizations and Extensions in the last hundred and fifty years (1862-2011), arXiv:1111.3057 [math.NT], 2011.
FORMULA
a(n) = denominator(sum((k+1)/(p-k-1), k=0..p-2)), where p = the n-th prime. - Gary Detlefs, Jan 12 2012
a(n) = numerator(H(p)/H(p-1)) - denominator(H(p)/H(p-1)), where p is the n-th prime and H(n) is the n-th harmonic number. - Gary Detlefs, Apr 21 2013
MAPLE
f2:=proc(n) local p;
p:=ithprime(n);
denom(add(1/i, i=1..p-1));
end proc;
[seq(f2(n), n=1..20)];
MATHEMATICA
nn = 20; sm = 0; t = Table[sm = sm + 1/k; Denominator[sm], {k, Prime[nn]}]; Table[t[[p - 1]], {p, Prime[Range[nn]]}] (* T. D. Noe, Apr 23 2013 *)
PROG
(PARI) a(n) = denominator(sum(k=1, prime(n)-1, 1/k)); \\ Michel Marcus, Dec 05 2018
(Magma) [Denominator(HarmonicNumber(NthPrime(n)-1)): n in [1..40]]; // Vincenzo Librandi, Dec 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jan 21 2012
STATUS
approved