login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #15 Dec 23 2018 11:31:44

%S 3,5,7,9,13,15,19,21,25,31,35,39,43,45,49,55,61,65,69,73,77,81,85,91,

%T 99,103,105,109,111,115,129,133,139,141,151,155,161,165,169,175,181,

%U 183,193,195,199,203,215,225,229,231,235,241,243,253,259,265,271,275,279

%N a(n) = the smallest integer > p(n) that is coprime to (p(n+1)-p(n)), where p(n) is the n-th prime.

%H Jens Kruse Andersen, <a href="/A157048/b157048.txt">Table of n, a(n) for n = 1..10000</a>

%e 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).

%t 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 *)

%t 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 *)

%o (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

%Y Cf. A001223, A157049.

%K nonn

%O 1,1

%A _Leroy Quet_, Feb 22 2009

%E More terms from _Robert G. Wilson v_, Apr 08 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 23:10 EDT 2024. Contains 372354 sequences. (Running on oeis4.)