OFFSET
1,1
COMMENTS
This sequence is a permutation of the primes.
EXAMPLE
The smallest prime not occurring among the first 8 terms of the sequence is 19; So a(9) = 19. The a(9)th prime = 19th prime is 67; so a(10) = 67.
MAPLE
A131200 := proc(nmax) local a, i, n; a := [2] ; for n from 2 to nmax do if n mod 2 = 0 then a := [op(a), ithprime(op(-1, a))] ; else for i from 1 do if not ithprime(i) in a then a := [op(a), ithprime(i)] ; break ; fi ; od; fi ; od; a ; end: A131200(80); # R. J. Mathar, Oct 30 2007
MATHEMATICA
a = {}; For[n = 1, n < 65, n++, If[OddQ[n], i = 1; While[Length[Intersection[{Prime[i]}, a]] > 0, i++ ]; AppendTo[a, Prime[i]], AppendTo[a, Prime[a[[ -1]]]]]]; a (* Stefan Steinerberger, Oct 27 2007 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Oct 21 2007
EXTENSIONS
More terms from Stefan Steinerberger and R. J. Mathar, Oct 27 2007
STATUS
approved