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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062042 a(1) = 2, a(n) = least number greater than a(n-1) such that a(n-1) + a(n) is a prime. 8
2, 3, 4, 7, 10, 13, 16, 21, 22, 25, 28, 31, 36, 37, 42, 47, 50, 51, 52, 55, 58, 69, 70, 79, 84, 89, 90, 91, 100, 111, 112, 115, 118, 121, 130, 133, 136, 141, 142, 151, 156, 157, 160, 171, 176, 177, 182, 185, 188, 191, 192, 197, 200, 201, 208, 211, 220, 223, 226 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

a(5) = 10 and the least number more than 10 that gives a prime when increased by 10 is 13, 13 + 10 = 23.

MAPLE

A[1]:= 2;

for n from 2 to 100 do

  A[n]:= nextprime(2*A[n-1])-A[n-1]

od:

seq(A[n], n=1..100); # Robert Israel, Aug 28 2018

MATHEMATICA

a=2; lst={a}; Do[b=a+1; While[ !PrimeQ[a+b], b++ ]; AppendTo[lst, b]; a=b, {n, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)

NestList[NextPrime[2#]-#&, 2, 60] (* Harvey P. Dale, Jul 20 2011 *)

PROG

(PARI) FirstTerms(n)={my(x=2, y, a=vector(n), j=1); a[1]=2; while(j++<=n, y=x+1; while(!isprime(x+y), y++); x=y; a[j]=y); return(a)} \\ R. J. Cano, Jan 18 2017

CROSSREFS

Cf. A062044.

Sequence in context: A097545 A202016 A073627 * A107817 A008811 A144678

Adjacent sequences:  A062039 A062040 A062041 * A062043 A062044 A062045

KEYWORD

nonn,easy

AUTHOR

Amarnath Murthy, Jun 05 2001

EXTENSIONS

More terms from Larry Reeves (larryr(AT)acm.org), Jun 06 2001

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 October 18 01:39 EDT 2021. Contains 348065 sequences. (Running on oeis4.)