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 A072029 #18 Feb 26 2024 01:22:47 %S A072029 1,2,5,4,3,10,7,8,25,6,13,20,11,14,15,16,17,50,19,12,35,26,23,40,9,22, %T A072029 125,28,29,30,31,32,65,34,21,100,37,38,55,24,41,70,43,52,75,46,47,80, %U A072029 49,18,85,44,53,250,39,56,95,58,61,60,59,62,175,64,33 %N A072029 Swap twin prime pairs of form (4*k+3,4*(k+1)+1) in prime factorization of n. %H A072029 Amiram Eldar, <a href="/A072029/b072029.txt">Table of n, a(n) for n = 1..10000</a> %H A072029 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A072029 Multiplicative with a(p) = (if p mod 4 = 3 and p+2 is prime then p+2 else (if p mod 4 = 1 and p-2 is prime then p-2 else p)), p prime. %F A072029 a(a(n))=n, a self-inverse permutation of natural numbers. %F A072029 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.37140598833326962... . - _Amiram Eldar_, Feb 26 2024 %e A072029 a(42) = a(2*3*7) = a(2)*a(3)*a(7) = a(2)*a(4*0+3)*a(7) = 2*(4*1+1)*7 = 2*5*7 = 70. %t A072029 a[n_] := Product[{p, e} = pe; Which[ %t A072029 Mod[p, 4] == 3 && PrimeQ[p + 2], p + 2, %t A072029 Mod[p, 4] == 1 && PrimeQ[p - 2], p - 2, %t A072029 True, p]^e, {pe, FactorInteger[n]}]; %t A072029 Array[a, 100] (* _Jean-François Alcover_, Nov 21 2021 *) %o A072029 (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p == 2, p, if(p%4 == 3 && isprime(p+2), p+2, if(p%4 == 1 && isprime(p-2), p-2, p)))^f[i,2]);} \\ _Amiram Eldar_, Feb 26 2024 %Y A072029 Cf. A061898, A064505, A071698, A071699, A072026, A072027, A072028. %K A072029 nonn,mult %O A072029 1,2 %A A072029 _Reinhard Zumkeller_, Jun 07 2002