This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A161186 #12 Aug 18 2022 10:34:15 %S A161186 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 A161186 49,50,51,52,55,57,58,62,63,64,66,69,70,72,75,76,77,78,81,82,84,85,87, %U A161186 88,90,91,92,93,94,98,99,100,102,104,108,110,112,114,115,116,117,120 %N A161186 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 A161186 The nonprime numbers are: [1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20]. %e A161186 Those with prime positions are: [4, 6, 9, 12, 18]. %e A161186 Those with nonprime positions are: [1, 8, 10, 14, 15, 16, 20]. %e A161186 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 A161186 (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 A161186 Cf. A078782, A102615. %Y A161186 Cf. A141436. %K A161186 easy,nonn %O A161186 1,2 %A A161186 _Daniel Tisdale_, Jun 05 2009, Jun 10 2009 %E A161186 More terms from _Michel Marcus_, Aug 18 2022