OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..300
FORMULA
a(n) = n*A002110(n). - L. Edson Jeffery, Jan 04 2015
EXAMPLE
a(3) = 90 because the first 3 primes are [2,3,5] and 3 / (1/2+1/3+1/5) = 90/31.
The first fractions are 2/1, 12/5, 90/31, 840/247, 11550/2927, 180180/40361, 3573570/716167, 77597520/14117683, ...
MAPLE
N:= 100: # to get a(1) to a(N)
B:= ListTools:-PartialSums([seq](1/ithprime(i), i=1..N)):
seq(numer(n/B[n]), n=1..N); # Robert Israel, Nov 13 2014
MATHEMATICA
Table[n/Sum[1/Prime[k], {k, 1, n}], {n, 1, 20}]//Numerator (* Vaclav Kotesovec, Nov 13 2014 *)
Table[n*Product[Prime[j], {j, n}], {n, 17}] (* L. Edson Jeffery, Jan 04 2015 *)
PROG
(PARI)
harmonicmean(v) = #v / sum(k=1, #v, 1/v[k])
s=vector(30); p=primes(#s); for(k=1, #p, s[k]=numerator( harmonicmean( vector(k, i, p[i])))); s
(PARI) n=0; P=1; forprime(p=2, 100, n++; P *= p; print1(n*P, ", ")) \\ Jeppe Stig Nielsen, Aug 11 2019
(Python)
from sympy import prime
from fractions import Fraction
def a(n):
return (n/sum(Fraction(1, prime(k)) for k in range(1, n+1))).numerator
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Feb 12 2021
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Colin Barker, Nov 13 2014
STATUS
approved