OFFSET
1,2
LINKS
FORMULA
a(a(n)) = n, a self-inverse permutation of natural numbers.
Multiplicative with a(p) = (if p<=3 then p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p, q primes > 3, p = q+2} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 0.53439004468579249988... . - Amiram Eldar, Dec 24 2022
EXAMPLE
a(143)=a(11*13)=a(11)*a(13)=13*11=143; a(77)=a(7*11)=a(7)*a(11)=5*13=65.
MATHEMATICA
a[n_] := Product[{p, e} = pe; If[p <= 3, p, If[PrimeQ[p+2], p+2, If[PrimeQ[p-2], p-2, p]]]^e, {pe, FactorInteger[n]}];
Array[a, 100] (* Jean-François Alcover, Nov 20 2021 *)
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Reinhard Zumkeller, Jun 07 2002
STATUS
approved