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 A072027 #14 Feb 26 2024 01:24:10 %S A072027 1,3,2,9,7,6,5,27,4,21,13,18,11,15,14,81,19,12,17,63,10,39,23,54,49, %T A072027 33,8,45,31,42,29,243,26,57,35,36,37,51,22,189,43,30,41,117,28,69,47, %U A072027 162,25,147,38,99,53,24,91,135,34,93,61,126,59,87,20,729,77 %N A072027 Swap (2,3) and all twin prime pairs >(3,5) in prime factorization of n. %H A072027 Amiram Eldar, <a href="/A072027/b072027.txt">Table of n, a(n) for n = 1..10000</a> %H A072027 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A072027 Multiplicative with a(p) = (if p<=3 then 5-p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime. %F A072027 a(a(n)) = n, self-inverse permutation of natural numbers. %F A072027 a(n) = n for single primes (A007510) and products of twin prime pairs (A037074). %F A072027 Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.832194438922717... . - _Amiram Eldar_, Feb 26 2024 %e A072027 a(143) = a(11*13) = a(11)*a(13) = 13*11 = 143. %e A072027 a(77) = a(7*11) = a(7)*a(11) = 5*13 = 65. %t A072027 f[p_, e_] := If[p < 5, 5 - p, If[PrimeQ[p + 2], p + 2, If[PrimeQ[p - 2], p - 2, p]]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Feb 26 2024 *) %o A072027 (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, 5-p, if(isprime(p+2), p+2, if(isprime(p-2), p-2, p)))^f[i,2]);} \\ _Amiram Eldar_, Feb 26 2024 %Y A072027 Cf. A001359, A006512, A007510, A037074, A061898, A064505, A072026, A072028, A072029. %K A072027 nonn,mult %O A072027 1,2 %A A072027 _Reinhard Zumkeller_, Jun 07 2002