Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #31 Oct 03 2024 13:42:03
%S 1,9,4,3,49,36,25,81,2,441,169,12,121,225,196,27,361,18,289,147,100,
%T 1521,841,324,7,1089,16,75,529,1764,1369,729,676,3249,1225,6,961,2601,
%U 484,3969,1849,900,1681,507,98,7569,2809,108,5,63,1444,363,2209,144
%N Result of changing both the prime indices and the exponents in the prime factorization of n: increment odd values, decrement even values.
%C A self-inverse permutation on the positive integers: a(a(n)) = n.
%H Alois P. Heinz, <a href="/A227324/b227324.txt">Table of n, a(n) for n = 1..10000</a>
%F Sum_{k=1..n} a(k) ~ c * n^3, where c = (1/3) * Product_{p prime} ((p-1)*(p^6 + q(p) +(p^3-1)*q(p)^2))/(p^7 - p*q(p)^2) = 0.3120270364..., where q(p) = nextprime(p) = A151800(p) if p has an odd index, and q(p) = prevprime(p) = A151799(p) otherwise. - _Amiram Eldar_, Sep 17 2023
%e n = 2^3 => a(n) = 3^4 = 81.
%e n = 3^2 => a(n) = 2^1 = 2.
%p a:= n-> mul(ithprime(i[1])^i[2], i=map(x->map(y->y-1+2*irem(y, 2),
%p [numtheory[pi](x[1]), x[2]]), ifactors(n)[2])):
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Jul 17 2013
%t a[n_] := If[n == 1, 1, Product[{p, e} = pe; Prime[BitXor[PrimePi[p] - 1, 1] + 1]^(BitXor[e - 1, 1] + 1), {pe, FactorInteger[n]}]];
%t Array[a, 100] (* _Jean-François Alcover_, May 31 2019, after _Andrew Howroyd_ *)
%o (PARI) a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); prime( bitxor( primepi(p)-1, 1)+1)^(bitxor(e-1, 1)+1))} \\ _Andrew Howroyd_, Jul 23 2018
%o (Python)
%o primes = [2]*2
%o primes[1] = 3
%o def addPrime(k):
%o for p in primes:
%o if k%p==0: return
%o if p*p > k: break
%o primes.append(k)
%o for n in range(5, 1000000, 6):
%o addPrime(n)
%o addPrime(n+2)
%o for n in range(1,99):
%o p = 1
%o j = n
%o i = 0
%o while j>1:
%o e = 0
%o while j % primes[i] == 0:
%o j /= primes[i]
%o e+=1
%o if e:
%o e = ((e-1)^1) + 1
%o p*= primes[i^1]**e
%o i += 1
%o print(str(p), end=', ')
%Y Cf. A003958-A003965, A011262, A011264, A045965-A045973, A151799, A151800.
%K nonn,easy,mult
%O 1,2
%A _Alex Ratushnyak_, Jul 07 2013
%E Keyword:mult added by _Andrew Howroyd_, Jul 23 2018