OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..13
N. J. A. Sloane, A Nasty Surprise in a Sequence and Other OEIS Stories, Experimental Mathematics Seminar, Rutgers University, Oct 10 2024, Youtube video; Slides [Mentions this sequence]
EXAMPLE
The first few fractions are 0/1, 1/2, 5/6, 14/15, 103/105, 1154/1155, 1336333/1336335, 892896284279/892896284280, ...
MAPLE
s:= proc(n) s(n):= `if`(n=0, 0, s(n-1)+1/(ithprime(n)*b(n))) end:
b:= proc(n) b(n):= 1+floor(1/((1-s(n-1))*ithprime(n))) end:
a:= n-> numer(s(n)):
seq(a(n), n=0..10); # Alois P. Heinz, Oct 18 2024
MATHEMATICA
s[n_] := s[n] = If[n == 0, 0, s[n - 1] + 1/(Prime[n]*b[n])];
b[n_] := b[n] = 1 + Floor[1/((1 - s[n - 1])*Prime[n])];
a[n_] := Numerator[s[n]];
Table[a[n], {n, 0, 10}] (* Jean-François Alcover, Apr 22 2025, after Alois P. Heinz *)
PROG
(Python)
from itertools import islice
from math import gcd
from sympy import nextprime
def A375521_gen(): # generator of terms
p, q, k = 0, 1, 1
while (k:=nextprime(k)):
m=q//(k*(q-p))+1
p, q = p*k*m+q, k*m*q
p //= (r:=gcd(p, q))
q //= r
yield p
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Rémy Sigrist and N. J. A. Sloane, Aug 30 2024
EXTENSIONS
a(0)=0 prepended by Alois P. Heinz, Oct 18 2024
STATUS
approved
