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!)
A072028 Swap twin prime pairs of form (4*k+1,4*k+3) in prime factorization of n. 4

%I #14 Feb 26 2024 01:23:00

%S 1,2,3,4,7,6,5,8,9,14,11,12,13,10,21,16,19,18,17,28,15,22,23,24,49,26,

%T 27,20,31,42,29,32,33,38,35,36,37,34,39,56,43,30,41,44,63,46,47,48,25,

%U 98,57,52,53,54,77,40,51,62,59,84,61,58,45,64,91,66

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

%H Amiram Eldar, <a href="/A072028/b072028.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 = 1 and p+2 is prime then p+2 else (if p mod 4 = 3 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.0627249749498993391... . - _Amiram Eldar_, Feb 26 2024

%e a(65) = a(5*13) = a(5)*a(13) = a(4*1+1)*a(13) = (4*1+3)*13 = 7*13 = 91.

%t f[p_, e_] := If[p < 5, p, If[(m = Mod[p, 4]) == 1 && PrimeQ[p + 2], p + 2, If[m == 3 && 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 (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, p, if(p%4 == 1 && isprime(p+2), p+2, if(p%4 == 3 && isprime(p-2), p-2, p)))^f[i,2]);} \\ _Amiram Eldar_, Feb 26 2024

%Y Cf. A061898, A064505, A071695, A071696, A072026, A072027, A072029.

%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 April 28 05:00 EDT 2024. Contains 372020 sequences. (Running on oeis4.)