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!)
A162662 Sequence of alternating increasing odd and increasing even numbers such that the sum of any two terms of opposite parity is a prime number. 0
1, 2, 3, 4, 9, 10, 27, 70, 57, 100, 267, 1060, 1227, 27790, 1479, 146380, 3459, 2508040, 49527, 35506900, 470079 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n+1) is taken to be the smallest number, greater than a(n-2), of opposite parity to a(n) that satisfies the condition.

A000034: Period 2: repeat [1, 2] is another sequence satisfying the definition without the increasing constraint. - Michel Marcus, Dec 22 2014

LINKS

Table of n, a(n) for n=1..21.

EXAMPLE

1060 + 267 = 1327 is prime;

1060 + 27 = 1087 is prime;

1060 + 9 = 1069 is prime;

1060 + 3 = 1063 is prime;

1060 + 1 = 1061 is prime.

MAPLE

with(numtheory):nn:=30:T:=array(1..nn): T[1]:=1:a:=1:for k from 2 to nn do:id:=0:for

  n from k to 1000000 while(id=0) do:n1:=irem(n, 2):i:=0:for p from 1 to a do:

  if n=T[p] then i:=0:else fi: x:=n+T[p]:if type(x, prime)=true then i:=i+1:else

  fi:od: if i=ceil(a/2) then T[k]:=n:print(n):a:=a+1:id:=1:else fi:od:od:

PROG

(PARI) ok(k, m, v) = {if (k % 2, js = 2, js = 1); forstep(j=js, m, 2, if (! isprime(k + v[j]), return (0)); ); return (1); }

findval(n, v) = {if (n <=2, k = n, k = v[n-2]+2); while (!ok (k, n-1, v), k+= 2); k; }

lista(nn) = {a = vector(nn); a[1] = 1; print1(a[1], ", "); for (n=2, nn, a[n] = findval(n, a); print1(a[n], ", "); ); } \\ Michel Marcus, Dec 22 2014

CROSSREFS

Cf. A180743, A115760.

Sequence in context: A329573 A291163 A180743 * A068334 A283874 A263092

Adjacent sequences:  A162659 A162660 A162661 * A162663 A162664 A162665

KEYWORD

nonn,more

AUTHOR

Michel Lagneau, Jan 27 2011

EXTENSIONS

a(18)-a(21) from Michel Marcus, Dec 22 2014

Name clarified by Michel Marcus, Dec 22 2014

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 June 21 10:09 EDT 2021. Contains 345360 sequences. (Running on oeis4.)