OFFSET
1,1
COMMENTS
Conjecture: a(n) > 0 for all n.
The smallest prime(k) > a(n-1) such that the denominator of A001223(k-1)/A001223(k) equals A001223(n)/2. - R. J. Mathar, Jan 07 2011
MAPLE
A001223 := proc(n) ithprime(n+1)-ithprime(n) ; end proc:
A178942 := proc(n) option remember; local p, q, r ; if n = 1 then 3; else for q from procname(n-1)+1 do if isprime(q) then p := prevprime(q) ; r := nextprime(q) ; denom((q-p)/(r-q)) ; if % = A001223(n)/2 then return q; end if; end if; end do: end if; end proc: # R. J. Mathar, Jan 07 2011
MATHEMATICA
A001223[n_] := Prime[n + 1] - Prime[n];
a[n_] := a[n] = Module[{p, q, r, d}, If[n == 1, 3, For[q = a[n - 1] + 1, True, q++, If [PrimeQ[q], p = NextPrime[q, -1]; r = NextPrime[q]; d = Denominator[(q - p)/(r - q)]; If[d == A001223[n]/2, Return[q]]]]]];
Array[a, 48] (* Jean-François Alcover, May 21 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Jan 06 2011
EXTENSIONS
More terms from Alois P. Heinz, Jan 06 2011
STATUS
approved