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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A129131 Alternately write composite and prime numbers. 2
4, 2, 6, 3, 8, 5, 9, 7, 10, 11, 12, 13, 14, 17, 15, 19, 16, 23, 18, 29, 20, 31, 21, 37, 22, 41, 24, 43, 25, 47, 26, 53, 27, 59, 28, 61, 30, 67, 32, 71, 33, 73, 34, 79, 35, 83, 36, 89, 38, 97, 39, 101, 40, 103, 42, 107, 44, 109, 45, 113, 46, 127, 48, 131, 49, 137, 50, 139, 51 (list; graph; refs; listen; history; internal format)
OFFSET

1,1

COMMENTS

a(2n-1) = A073846(2n+1), a(2n) = A073846(2n).

EXAMPLE

Lowest composite number is 4, lowest prime number is 2, next composite number after 4 is 6, next prime number after 2 is 3 and so on.

MATHEMATICA

f[n_]:=Module[{prs=Prime[Range[n]], comps}, comps=Rest[Complement[Range[n+ Length[prs]+1], prs]]; Riffle[comps, prs]] (* From Harvey P. Dale, May 10 2011 *)

PROG

(MAGMA) P:=[ n : n in [2..150] | IsPrime(n) ]; C:=[ n : n in [2..70] | not IsPrime(n) ]; &cat[ [C[k], P[k] ]: k in [1..Minimum(#C, #P)] ]; /* Klaus Brockhaus, Mar 31 2007 */

CROSSREFS

Cf. A000040 (prime numbers), A002808 (composite numbers), A073846 (alternate nonprime and prime numbers).

Sequence in context: A143308 A163238 A097362 * A097467 A169839 A187109

Adjacent sequences:  A129128 A129129 A129130 * A129132 A129133 A129134

KEYWORD

nonn,easy

AUTHOR

Edwin F. Sampang (efs_files(AT)yahoo.com), Mar 30 2007

EXTENSIONS

Edited and extended by Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), Mar 31 2007

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 February 16 09:50 EST 2012. Contains 205904 sequences.