The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A225581 a(n) is the minimal odd prime q such that prime(n)*q + prime(n) + q is prime. 2

%I #36 Sep 07 2021 19:49:37

%S 3,5,3,3,3,5,3,3,7,5,3,3,3,5,3,7,3,11,3,5,5,5,5,3,5,11,17,3,3,5,47,11,

%T 5,5,3,3,3,5,13,11,3,3,5,5,5,11,11,11,3,3,7,5,3,5,3,5,5,3,5,13,11,7,3,

%U 5,11,5,3,5,5,3,19,3,3,5,29,17,3,23,3,5,7,5,5,71,3,5,5,3,3,47,3,5,3,11,3,5,3,3,11,5,23

%N a(n) is the minimal odd prime q such that prime(n)*q + prime(n) + q is prime.

%H John-Å. W. Olsen, <a href="/A225581/b225581.txt">Table of n, a(n) for n = 1..1000</a>

%e n = 1; p = 2; q = 3;

%e n = 2; p = 3; q = 5;

%e n = 3; p = 5; q = 3;

%e n = 4; p = 7; q = 3;

%t a[n_] := Block[{q = 3, p = Prime@n},While[! PrimeQ[p*q + p + q], q = NextPrime@q]; q]; Array[a, 101] (* _Giovanni Resta_, May 11 2013 *)

%o (PARI) a(n) = my(q=3, p=prime(n)); while(!isprime(p*q+p+q), q = nextprime(q+1)); q; \\ _Michel Marcus_, Sep 06 2021

%o (Python)

%o from sympy import isprime, nextprime, prime

%o def a(n):

%o q, p = 3, prime(n)

%o while not isprime(p*q + p + q): q = nextprime(q)

%o return q

%o print([a(n) for n in range(1, 102)]) # _Michael S. Branicky_, Sep 06 2021

%Y Cf. A000040.

%K nonn,easy

%O 1,1

%A _John-Å. W. Olsen_, May 11 2013

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 June 15 10:19 EDT 2024. Contains 373407 sequences. (Running on oeis4.)