|
|
A157048
|
|
a(n) = the smallest integer > p(n) that is coprime to (p(n+1)-p(n)), where p(n) is the n-th prime.
|
|
2
|
|
|
3, 5, 7, 9, 13, 15, 19, 21, 25, 31, 35, 39, 43, 45, 49, 55, 61, 65, 69, 73, 77, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 155, 161, 165, 169, 175, 181, 183, 193, 195, 199, 203, 215, 225, 229, 231, 235, 241, 243, 253, 259, 265, 271, 275, 279
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
The 11th prime is 31. The 12th prime is 37. 37-31 = 6. The smallest integer > 31 that is coprime to 6 is 35, which is a(11).
|
|
MATHEMATICA
|
f[n_] := Block[{k, p = Prime@n, q = Prime[n + 1]}, k = p + 1; While[ GCD[q - p, k] > 1, k++ ]; k]; Array[f, 59] (* Robert G. Wilson v, Apr 08 2009 *)
sicp[n_]:=Module[{k=n[[1]]+1, d=n[[2]]-n[[1]]}, While[!CoprimeQ[k, d] , k++]; k]; sicp/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Dec 23 2018 *)
|
|
PROG
|
(PARI) a(n) = d=prime(n+1)-prime(n); k=prime(n)+1; while(gcd(k, d)>1, k++); k \\ Jens Kruse Andersen, Jul 31 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|