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

%I #18 Feb 26 2024 01:22:47

%S 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 125,28,29,30,31,32,65,34,21,100,37,38,55,24,41,70,43,52,75,46,47,80,

%U 49,18,85,44,53,250,39,56,95,58,61,60,59,62,175,64,33

%N Swap twin prime pairs of form (4*k+3,4*(k+1)+1) in prime factorization of n.

%H Amiram Eldar, <a href="/A072029/b072029.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.

%F 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 a(a(n))=n, a self-inverse permutation of natural numbers.

%F 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 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 a[n_] := Product[{p, e} = pe; Which[

%t Mod[p, 4] == 3 && PrimeQ[p + 2], p + 2,

%t Mod[p, 4] == 1 && PrimeQ[p - 2], p - 2,

%t True, p]^e, {pe, FactorInteger[n]}];

%t Array[a, 100] (* _Jean-François Alcover_, Nov 21 2021 *)

%o (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 Cf. A061898, A064505, A071698, A071699, A072026, A072027, A072028.

%K nonn,mult

%O 1,2

%A _Reinhard Zumkeller_, Jun 07 2002

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 May 5 04:20 EDT 2024. Contains 372257 sequences. (Running on oeis4.)