OFFSET
1,4
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..350
FORMULA
EXAMPLE
a(1) = (p_1# / p_1) - p_1 = (2 / 2) - 2 = -1.
a(2) = (p_2# / p_1 + p_2# * p_2) - p_1 * p_2 = (6 / 2 + 6 / 3) - 2 * 3 = -1.
a(3) = 2*3*5/2 + 2*3*5/3 + 2*3*5/5 - 2*3*5 = 31 - 30 = 1.
MATHEMATICA
Numerator[#]-Denominator[#]&/@Accumulate[1/Prime[Range[20]]] (* Harvey P. Dale, Feb 05 2023 *)
PROG
(Python)
from itertools import islice
from sympy import primorial, sieve
def a(n): return sum(primorial(n) // p for p in islice(sieve, n)) - primorial(n) # Greg Tener, Oct 18 2021
(PARI) a(n) = my(q=sum(i=1, n, 1/prime(i))); numerator(q)-denominator(q); \\ Michel Marcus, Oct 18 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Greg Tener, Oct 10 2021
STATUS
approved