login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179295 a(n) is the least prime number such that prime(n)+a(n)+1 is a prime or -1 if no such prime number exists. 1
2, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 3, 5, 3, 5, 5, 7, 5, 3, 7, 5, 3, 5, 7, 3, 5, 3, 5, 3, 13, 3, 5, 11, 11, 7, 5, 5, 3, 5, 5, 11, 11, 5, 3, 13, 11, 11, 3, 5, 3, 5, 11, 29, 5, 5, 5, 7, 5, 3, 11, 23, 13, 3, 5, 3, 13, 5, 11, 5, 3, 5, 7, 5, 5, 3, 5, 7, 3, 7, 11, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

If Maillet's conjecture is true, then a(n) != -1 for all n. - Chai Wah Wu, Aug 01 2017

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..10000

Wen Huang and XiaoSheng Wu, On the set of the difference of primes,  Proc. Amer. Math. Soc. 145 (2017), 3787-3793.

E. Maillet, Réponse, L’intermédiaire des math. 12 (1905), p. 108.

EXAMPLE

a(1) = 2, since prime(1) + 2 + 1 = 5.

MATHEMATICA

Table[Block[{p=2}, While[!PrimeQ[Prime[n] + p + 1], p=NextPrime[p]]; p], {n, 100}] (* Indranil Ghosh, Jun 30 2017 *)

PROG

(ANS Forth)

\ https://github.com/Lehs/ANS-Forth-libraries

s" numbertheory.4th" included

: get_number \ p -- q

  locals| p | 1

  begin nextprime dup p + 1+ isprime

  until ;

: list_numbers \ N --

  locals| N | 1

  begin nextprime dup

     get_number cr .

     dup N >

  until ;

(PARI) a(n) = my(pn=prime(n), p=2); while(! isprime(pn+p+1), p = nextprime(p+1)); p; \\ Michel Marcus, Jun 30 2017

(Python)

from sympy import prime, isprime, nextprime

def a(n):

    p=2

    while not isprime(prime(n) + p + 1): p=nextprime(p)

    return p

print [a(n) for n in xrange(1, 101)] # Indranil Ghosh, Jun 30 2017

CROSSREFS

Sequence in context: A201769 A077276 A073684 * A083776 A122820 A261324

Adjacent sequences:  A179292 A179293 A179294 * A179296 A179297 A179298

KEYWORD

nonn

AUTHOR

Lars-Erik Svahn, Jun 21 2017

EXTENSIONS

Definition clarified by Chai Wah Wu, Aug 01 2017

More terms from Chai Wah Wu, Aug 02 2017

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:50 EDT 2019. Contains 322290 sequences. (Running on oeis4.)