login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072029 Swap twin prime pairs of form (4*k+3,4*(k+1)+1) in prime factorization of n. 5
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, 125, 28, 29, 30, 31, 32, 65, 34, 21, 100, 37, 38, 55, 24, 41, 70, 43, 52, 75, 46, 47, 80, 49, 18, 85, 44, 53, 250, 39, 56, 95, 58, 61, 60, 59, 62, 175, 64, 33 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
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.
a(a(n))=n, a self-inverse permutation of natural numbers.
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
EXAMPLE
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.
MATHEMATICA
a[n_] := Product[{p, e} = pe; Which[
Mod[p, 4] == 3 && PrimeQ[p + 2], p + 2,
Mod[p, 4] == 1 && PrimeQ[p - 2], p - 2,
True, p]^e, {pe, FactorInteger[n]}];
Array[a, 100] (* Jean-François Alcover, Nov 21 2021 *)
PROG
(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
CROSSREFS
Sequence in context: A266403 A266415 A132664 * A309734 A309668 A238758
KEYWORD
nonn,mult
AUTHOR
Reinhard Zumkeller, Jun 07 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)