login
In the sequence of nonprime numbers, an element k's position is either prime or nonprime. If k's position is prime, f(k)= the k-th nonprime-positioned element, else f(k) is the k-th prime-positioned element. Iterated application of x-> f(x) gives disjoint sequences generated by the first elements, which form the current sequence.
0

%I #12 Aug 18 2022 10:34:15

%S 1,6,8,9,10,12,15,18,20,21,22,25,26,27,32,33,34,35,36,38,40,44,45,48,

%T 49,50,51,52,55,57,58,62,63,64,66,69,70,72,75,76,77,78,81,82,84,85,87,

%U 88,90,91,92,93,94,98,99,100,102,104,108,110,112,114,115,116,117,120

%N In the sequence of nonprime numbers, an element k's position is either prime or nonprime. If k's position is prime, f(k)= the k-th nonprime-positioned element, else f(k) is the k-th prime-positioned element. Iterated application of x-> f(x) gives disjoint sequences generated by the first elements, which form the current sequence.

%e The nonprime numbers are: [1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20].

%e Those with prime positions are: [4, 6, 9, 12, 18].

%e Those with nonprime positions are: [1, 8, 10, 14, 15, 16, 20].

%e So we have {f(1)} = {1,4,14,60,...}, {f(6)} = {6,16,74,...}, {f(8)} ={8,28,56,...}; so the current sequence are the first elements, {1,6,8,...etc}.

%o (PARI) lista(nn) = {my(va = select(x->(! isprime(x)), [1..nn])); my(vap = vector(primepi(#va), k, va[prime(k)])); my(vanp = Vec(setminus(va, vap))); my(vused = vector(#va), ok=1, last=0, list=List(), new, ok2); while(ok, last++; while ((last <= #vused) && vused[last], last++); if (last > #vused, break); new = va[last]; listput(list, new); ok2 = 1; my(list1 = List()); listput(list1, new); while(ok2, pos = setsearch(va, new); if (!pos, ok2=0, vused[pos] = 1; if (isprime(pos), if (new <= #vanp, new = vanp[new], ok2=0), if (new <= #vap, new = vap[new], ok2=0);); listput(list1, new);););); Vec(list);} \\ _Michel Marcus_, Aug 18 2022

%Y Cf. A078782, A102615.

%Y Cf. A141436.

%K easy,nonn

%O 1,2

%A _Daniel Tisdale_, Jun 05 2009, Jun 10 2009

%E More terms from _Michel Marcus_, Aug 18 2022