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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A159698 Minimal increasing sequence beginning with 4 such that n and a(n) are either both prime or both composite. 5
4, 5, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 30, 32, 33, 37, 38, 39, 40, 42, 44, 47, 48, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 67, 68, 71, 72, 74, 75, 79, 80, 81, 82, 84, 85, 89, 90, 91, 92, 93, 94, 97, 98, 101, 102, 104, 105, 106, 108, 109, 110, 111, 112 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

For n>=11, a(n)=A159559(n-1), which means the two sequences merge.

We may define other sequences a(p-1,n), p prime, which start a(p-1,1)=p-1 and with the same property of n and a(p-1,n) being jointly prime or composite.

We find that for p=7, 11 and 13, the sequences a(6,n), a(10,n) and a(12,n) also merge with the current sequence for sufficiently large n. Does this also hold for primes >=17?

It was verified for primes p with 7<=p<=223 that this sequence a(4,n) and a(p-1,n) eventually merge.  The corresponding values of n are 47, 683, 1117, 6257, 390703. - Alois P. Heinz, Mar 09 2011

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..1000

V. Shevelev Several results on sequences which are similar to the positive integers

FORMULA

a(1) = 4; for n>1, a(n) = min { m > a(n-1) : m is prime iff n is prime }.

MAPLE

a:= proc(n) option remember; local m;

      if n=1 then 4

    else for m from a(n-1)+1 while isprime(m) xor isprime(n)

         do od; m

      fi

    end:

seq (a(n), n=1..80);  # Alois P. Heinz, Nov 21 2010

CROSSREFS

Cf. A159559, A159560, A159615, A159619, A159629.

Sequence in context: A032722 A098416 A005556 * A191276 A047377 A188265

Adjacent sequences:  A159695 A159696 A159697 * A159699 A159700 A159701

KEYWORD

nonn,easy

AUTHOR

Vladimir Shevelev, Apr 20 2009, May 04 2009

EXTENSIONS

More terms from Alois P. Heinz, Nov 21 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified June 19 14:08 EDT 2013. Contains 226411 sequences.