OFFSET
3,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 3..344
FORMULA
a(n) = numerator((prime(n)-1)*(Sum_{k=1..prime(n)-1} 1/k))/prime(n)^2 for n > 2.
a(n) = A096617(p-1)/p^2 for p = prime(n) > 3.
MAPLE
N:= 50: # to get the first N terms
Primes:= select(isprime, [seq(2*i+1, i=2..(ithprime(N+2)-1)/2)]):
H:= ListTools[PartialSums]([seq(1/i, i=1..Primes[-1]-1)]):
seq(numer((p-1)*H[p-1])/p^2, p=Primes); # Robert Israel, Sep 09 2014
MATHEMATICA
Numerator[Table[(Prime[n]-1)*(Sum[(1/k), {k, 1, Prime[n]-1}]), {n, 3, 20}]]/Table[Prime[n]^2, {n, 3, 20}]
Table[((p-1)HarmonicNumber[p-1])/p^2, {p, Prime[Range[2, 20]]}]//Numerator (* Harvey P. Dale, May 19 2021 *)
PROG
(PARI) {a(n) = numerator((prime(n)-1)*sum(k=1, prime(n)-1, 1/k)/prime(n)^2)};
for(n=3, 25, print1(a(n), ", ")) \\ G. C. Greubel, Sep 02 2018
(Magma) [Numerator((NthPrime(n)-1)*HarmonicNumber(NthPrime(n)-1)/NthPrime(n)^2): n in [3..25]]; // G. C. Greubel, Sep 02 2018
CROSSREFS
KEYWORD
frac,nonn
AUTHOR
Alexander Adamchuk, Jul 16 2006
STATUS
approved