The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A163981 a(n) is the smallest prime of the form prime(n+1)*k - prime(n), k >= 1, where prime(n) is the n-th prime. 2
 7, 2, 2, 37, 2, 89, 2, 73, 151, 2, 43, 127, 2, 239, 59, 419, 2, 73, 359, 2, 401, 419, 1163, 881, 307, 2, 967, 2, 569, 3697, 397, 691, 2, 457, 2, 163, 821, 839, 179, 1259, 2, 2111, 2, 1777, 2, 223, 3803, 3863, 2, 3499, 1201, 2, 2269, 263, 269, 1889, 2, 283, 1409, 2, 2647 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS a(n) = 2 if and only if n is in A029707. - Robert Israel, Jan 16 2019 LINKS Robert Israel, Table of n, a(n) for n = 1..10000 MAPLE a := proc (n) local k: for k while isprime(ithprime(n+1)*k-ithprime(n)) = false do end do: ithprime(n+1)*k-ithprime(n) end proc: seq(a(n), n = 1 .. 65); # Emeric Deutsch, Aug 10 2009 MATHEMATICA a[n_] := Module[{p, q, r}, For[p = Prime[n]; q = Prime[n + 1]; k = 1, True, k++, If[PrimeQ[r = q k - p], Return[r]]]]; Array[a, 100] (* Jean-François Alcover, Aug 28 2020 *) PROG (Python) from sympy import isprime, nextprime, prime def a(n):     pn = prime(n); pn1 = nextprime(pn); k = 1     while not isprime(pn1*k - pn): k += 1     return pn1*k - pn print([a(n) for n in range(1, 62)]) # Michael S. Branicky, Jul 02 2021 (PARI) a(n) = my(k=1); while (!isprime(p=prime(n+1)*k - prime(n)), k++); p; \\ Michel Marcus, Jul 02 2021 CROSSREFS Cf. A029707, A129919. Contains A085704. Sequence in context: A154759 A300304 A208647 * A126341 A324788 A078087 Adjacent sequences:  A163978 A163979 A163980 * A163982 A163983 A163984 KEYWORD nonn AUTHOR Leroy Quet, Aug 07 2009 EXTENSIONS Extended by Emeric Deutsch, Aug 10 2009 STATUS approved

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

Last modified July 28 07:27 EDT 2021. Contains 346319 sequences. (Running on oeis4.)