login
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
OFFSET
1,1
COMMENTS
a(2n-1) = A073846(2n+1), a(2n) = A073846(2n).
FORMULA
a(n) = A066249(n) + 1. - Filip Zaludek, Dec 10 2016
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]] (* 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: A297307 A163238 A097362 * A237056 A285296 A257885
KEYWORD
nonn,easy
AUTHOR
Edwin F. Sampang, Mar 30 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Mar 31 2007
STATUS
approved