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
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
n = 1; p = 2; q = 3;
n = 2; p = 3; q = 5;
n = 3; p = 5; q = 3;
n = 4; p = 7; q = 3;
MATHEMATICA
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 *)
PROG
(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
(Python)
from sympy import isprime, nextprime, prime
def a(n):
q, p = 3, prime(n)
while not isprime(p*q + p + q): q = nextprime(q)
return q
print([a(n) for n in range(1, 102)]) # Michael S. Branicky, Sep 06 2021
CROSSREFS
Cf. A000040.
Sequence in context: A161670 A135514 A251754 * A275391 A092553 A112755
KEYWORD
nonn,easy
AUTHOR
John-Å. W. Olsen, May 11 2013
STATUS
approved

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 April 25 09:56 EDT 2024. Contains 371967 sequences. (Running on oeis4.)