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 A167419 #13 May 10 2023 23:04:58 %S A167419 2,1,4,3,6,5,8,7,9,11,10,13,12,14,15,17,16,19,18,20,21,23,22,24,25,26, %T A167419 27,29,28,31,30,32,33,34,35,37,36,38,39,41,40,43,42,44,45,47,46,48,49, %U A167419 50,51,53,52,54,55,56,57,59,58,61,60,62,63,64,65,67,66,68,69,71,70,73,72 %N A167419 Exchange adjacent nonprimes and primes. %C A167419 If we have consecutive numbers, one prime and one nonprime, swap them. So after the initial 2,1,4,3,6,5,8,7 we have "if n is prime, a(n) = n-1; if n+1 is prime, a(n) = n+1, otherwise a(n) = n". %H A167419 Stefano Spezia, <a href="/A167419/b167419.txt">Table of n, a(n) for n = 1..10000</a> %t A167419 a[n_]:=If[PrimeQ[n],n-1,If[PrimeQ[n+1],n+1,n]]; Join[{2,1,4,3,6,5,8,7},Array[a,65,9]] (* _Stefano Spezia_, May 05 2023 *) %Y A167419 Cf. A014681. %K A167419 easy,nonn %O A167419 1,1 %A A167419 _Giovanni Teofilatto_, Nov 03 2009 %E A167419 Edited by _Franklin T. Adams-Watters_, Nov 04 2009 %E A167419 42 and 64 inserted by _Stefano Spezia_, May 05 2023