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 A067747 #48 Mar 07 2021 01:16:56 %S A067747 2,4,3,6,5,8,7,9,11,10,13,12,17,14,19,15,23,16,29,18,31,20,37,21,41, %T A067747 22,43,24,47,25,53,26,59,27,61,28,67,30,71,32,73,33,79,34,83,35,89,36, %U A067747 97,38,101,39,103,40,107,42,109,44,113,45,127,46,131,48,137,49,139 %N A067747 Primes interleaved between composite numbers: n-th prime followed by the n-th composite number. %C A067747 a(2*n-1) = A000040(n); a(2*n) = A002808(n). - _Reinhard Zumkeller_, Jan 29 2014 %H A067747 Zak Seidov, <a href="/A067747/b067747.txt">Table of n, a(n) for n = 1..1000.</a> %H A067747 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A067747 a(2*n-1) = A000040(n); a(2*n) = A002808(n). - _Reinhard Zumkeller_, Jan 29 2014 %F A067747 a(n) = A000040(ceiling(n/2))*A000035(n) + A002808(ceiling(n/2))*A059841(n), equivalent to the Zumkeller formula. - _Chayim Lowen_, Jul 29 2015 %e A067747 For n=4, the index is even. Therefore a(4)=A002808(4/2)=A002808(2)=6. %p A067747 P,C:= selectremove(isprime,[$2..1000]): %p A067747 seq(op([P[i],C[i]]),i=1..min(nops(P),nops(C))); # _Robert Israel_, Jul 24 2015 %t A067747 Array[c,1000];pc=-1;nc=0;Do[If[PrimeQ[n],If[pc==999,Break[],pc+=2;c[pc]=n],If[nc<=998,nc+=2;c[nc]=n,Goto[ne]]];Label[ne],{n,2,20000}];Table[c[i],{i,1000}] (* _Zak Seidov_, Mar 22 2008 *) %t A067747 Composite[n_Integer] := FixedPoint[n + PrimePi@ # + 1 &, n + PrimePi@ n + 1]; Table[{Prime@ n, Composite@ n}, {n, 35}] // Flatten (* _Robert G. Wilson v_, Jun 08 2008 *) %o A067747 (Haskell) %o A067747 import Data.List (transpose) %o A067747 a067747 n = a067747_list !! (n-1) %o A067747 a067747_list = concat $ transpose [a000040_list, a002808_list] %o A067747 -- _Reinhard Zumkeller_, Jan 29 2014 %o A067747 (PARI) c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808 %o A067747 a(n) = if (n%2, prime((n+1)/2), c((n+1)\2)); \\ _Michel Marcus_, Mar 06 2021 %Y A067747 Cf. A073846, A002808, A000040. %K A067747 easy,nonn %O A067747 1,1 %A A067747 _Amarnath Murthy_, Feb 26 2002