OFFSET
1,1
COMMENTS
A157048(n) - A157049(n) = 1,2,4,8,10,14,16,20,24,28,34,38,40,44,48,54,..., ; a strictly monotonically increasing sequence. - Robert G. Wilson v, Apr 08 2009
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
EXAMPLE
The 11th prime is 31. The 12th prime is 37. 37-31 = 6. The largest integer < 37 that is coprime to 6 is 35, which is a(11).
MATHEMATICA
f[n_] := Block[{k, p = Prime@n, q = Prime[n + 1]}, k = q - 1; While[ GCD[q - p, k] > 1, k-- ]; k]; Array[f, 59] (* Robert G. Wilson v, Apr 08 2009 *)
PROG
(PARI) a(n) = d=prime(n+1)-prime(n); k=prime(n+1)-1; while(gcd(k, d)>1, k--); k \\ Jens Kruse Andersen, Jul 31 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 22 2009
EXTENSIONS
More terms from Robert G. Wilson v, Apr 08 2009
STATUS
approved