

A175938


Repeat: Take next nonprime, next prime, next nonprime, then reverse the order.


0



4, 2, 1, 8, 3, 6, 10, 5, 9, 14, 7, 12, 16, 11, 15, 20, 13, 18, 22, 17, 21, 25, 19, 24, 27, 23, 26, 30, 29, 28, 33, 31, 32, 35, 37, 34, 38, 41, 36, 40, 43, 39, 44, 47, 42, 46, 45, 53, 49, 48, 59, 51, 50, 61, 54, 52, 67, 56, 55, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Start with first nonprime 1 and first prime 2. To obtain the first three terms take first nonprime 1, first prime 2, next nonprime 4, then reverse the order to get 4, 2, 1. Next step: take next nonprime 6, next prime 3, next nonprime 8 and reverse to get 8, 3, 6. It is obvious that the sequence is a permutation of positive integers. It is closely related to the lexicographically earliest permutation of the natural numbers such that each prime number is followed by exactly two composite numbers (cf. A115316). It is also related in a certain way to the number of primes <= n, PrimePi(n) (cf. A000720).
Conjecture: The permutation has exactly 12 fixed points: 2, 6, 9, 12, 15, 18, 21, 24, 29, 40, 46, 49.
From D. S. McNeil, Dec 09 2010: (Start)
The conjecture is true, roughly because the primes are packed far too closely (one every three terms, after all) and as a result the nonprimes are too spread out.
First consider the primes: after permutation the kth prime p shows up at 3*k1, so to be a fixed point we need p=3*k1. Note that k=prime_pi(p), so we seek solutions to p=3*pi(p)1, which cannot occur if p > 3*pi(p)1 (i.e., if the prime is larger than its destination), or equivalently if pi(p) < (p+1)/3. Using pi(n) < 1.25506*n/log(n) for n > 1, we find there can be no prime fixed points for p >= 40. Inspection reveals only 2 and 29.
Now consider the nonprimes: after permutation the kth nonprime r appears either at 3*(k+1)/2 (if k is odd) or 3*k/22 (if k is even). Write k = nonprime_pi(r) = rpi(r). To prove r appears at an index > r, it suffices to show 3*k/22 > r, or pi(r) < r/3  4/3. Again, we have that pi(n) < 1.25506*n/log(n), which rules out nonprime fixed points with r >= 58. By inspection we find the remaining terms, and the set is complete. QED. I would appreciate it if someone would check this proof. (End)
The first trisection of the sequence equals the second bisection of the nonprimes: a(3*k2) = A018252(2*k), k > 0.
The second trisection of the sequence equals the primes: a(3*k1) = A000040(k), k > 0.
The third trisection of the sequence equals the first bisection of the nonprimes: a(3*k) = A018252(2*k1), k > 0.
In other words: Sequence is the interleaving of second bisection of A018252, A000040, first bisection of A018252.
Sequence is the concatenation of consecutive sections of length 3 reversed of A115316.


LINKS

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


MATHEMATICA

pr=Prime[Range[1000]]; np=Complement[Range[pr[[1]]], pr];
FL=Flatten@Transpose[{Table[np[[k]], {k, 2, 1000, 2}], Take[pr, 500], Table[np[[k]], {k, 1, 999, 2}]}]


CROSSREFS

Cf. A000040, A018252, A002808, A115316, A000720.
Sequence in context: A142073 A193559 A135294 * A117016 A338255 A013659
Adjacent sequences: A175935 A175936 A175937 * A175939 A175940 A175941


KEYWORD

nonn


AUTHOR

Zak Seidov, Dec 06 2010


STATUS

approved



