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 A354225 #13 May 22 2022 14:05:46 %S A354225 1,3,2,6,7,4,5,12,15,14,13,8,11,10,9,24,19,27,17,28,33,26,29,16,35,22, %T A354225 18,20,23,42,37,48,21,38,25,54,31,34,51,56,43,30,41,52,63,58,53,32,77, %U A354225 70,39,44,47,36,65,40,69,46,61,84,59,74,45,96,55,78,71 %N A354225 Lexicographically earliest sequence of distinct positive integers such that a(1) = 1 and for any n > 1, n / gcd(n, a(n)) and a(n) / gcd(n, a(n)) are prime. %C A354225 This sequence is a self-inverse permutation of the positive integers that preserves the number of prime divisors (with or without multiplicity). %H A354225 Michael De Vlieger, <a href="/A354225/b354225.txt">Table of n, a(n) for n = 1..10000</a> %H A354225 Michael De Vlieger, <a href="/A354225/a354225.png">Annotated log-log plot of a(n)</a>, n = 1..2^14, showing records in red, local minima in blue, highlighting primes in green, fixed points in gold, and composite prime powers in magenta. %H A354225 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A354225 a(prime(2*n)) = prime(2*n-1) (where prime(n) denotes the n-th prime number). %e A354225 The first terms are: %e A354225 n a(n) g=gcd(n, a(n)) n/g a(n)/g %e A354225 -- ---- -------------- --- ------ %e A354225 1 1 1 1 1 %e A354225 2 3 1 2 3 %e A354225 3 2 1 3 2 %e A354225 4 6 2 2 3 %e A354225 5 7 1 5 7 %e A354225 6 4 2 3 2 %e A354225 7 5 1 7 5 %e A354225 8 12 4 2 3 %e A354225 9 15 3 3 5 %e A354225 10 14 2 5 7 %e A354225 11 13 1 11 13 %e A354225 12 8 4 3 2 %e A354225 13 11 1 13 11 %e A354225 14 10 2 7 5 %t A354225 nn = 120; c[_] = 0; a[1] = c[1] = 1; u = 2; Do[k = u; While[Nand[c[k] == 0, AllTrue[{i/#, k/#}, PrimeQ] &@ GCD[i, k]], k++]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 0, u++]], {i, 2, nn}]; Array[a, nn] (* _Michael De Vlieger_, May 22 2022 *) %o A354225 (PARI) s=0; for (n=1, 67, for (v=1, oo, if (!bittest(s, v) && (n==1 || (isprime(n/g=gcd(n,v)) && isprime(v/g))), print1 (v", "); s+=2^v; break))) %Y A354225 Cf. A122280. %K A354225 nonn %O A354225 1,2 %A A354225 _Rémy Sigrist_, May 20 2022