login
Self-inverse permutation of natural numbers: a(n) = A064989(A263273(A003961(n))).
9

%I #19 Jan 09 2016 14:27:14

%S 1,2,5,4,3,10,17,8,13,6,11,20,9,34,71,16,7,26,19,12,23,22,21,40,41,18,

%T 227,68,31,142,29,32,53,14,67,52,61,38,107,24,25,46,59,44,65,42,73,80,

%U 49,82,197,36,33,454,55,136,137,62,43,284,37,58,571,64,45,106,35,28,89,134,15,104,47

%N Self-inverse permutation of natural numbers: a(n) = A064989(A263273(A003961(n))).

%C Shift primes in the prime factorization of n one step towards larger primes (A003961), then apply the bijective base-3 reverse (A263273) to the resulting odd number, which yields another (or same) odd number, then shift primes in the prime factorization of that second odd number one step back towards smaller primes (A064989).

%H Antti Karttunen, <a href="/A266401/b266401.txt">Table of n, a(n) for n = 1..6560</a>

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

%F a(n) = A064989(A263273(A003961(n))).

%F As a composition of related permutations:

%F a(n) = A064216(A264996(A048673(n))).

%F Other identities. For all n >= 0:

%F A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]

%t f[n_] := Block[{g, h}, g[x_] := x/3^IntegerExponent[x, 3]; h[x_] := x/g@ x; If[n == 0, 0, FromDigits[Reverse@ IntegerDigits[#, 3], 3] &@ g[n] h[n]]]; g[p_?PrimeQ] := g[p] = Prime[PrimePi@ p + 1]; g[1] = 1; g[n_] := g[n] = Times @@ (g[First@ #]^Last@ # &) /@ FactorInteger@ n; h[n_] := Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n; Table[h@ f@ g@ n, {n, 82}] (* _Michael De Vlieger_, Jan 04 2016, after _Jean-François Alcover_ at A003961 and A263273 *)

%o (PARI)

%o A030102(n) = { my(r=[n%3]); while(0<n\=3, r=concat(n%3, r)); subst(Polrev(r),x,3); } \\ After _M. F. Hasler_'s Nov 04 2011 code in A030102.

%o A263273 = n -> if(!n,n,A030102(n/(3^valuation(n,3))) * (3^valuation(n, 3))); \\ Taking of the quotient probably unnecessary.

%o A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus

%o A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};

%o A266401 = n -> A064989(A263273(A003961(n)));

%o for(n=1, 6560, write("b266401.txt", n, " ", A266401(n)));

%o (Scheme) (define (A266401 n) (A064989 (A263273 (A003961 n))))

%Y Cf. A000035, A003961, A064989, A263273.

%Y Cf. A265369, A265904, A266190, A266403 (other conjugates or similar sequences derived from A263273).

%Y Cf. also A048673, A064216, A264996, A266402, A266407, A266408.

%K nonn,base

%O 1,2

%A _Antti Karttunen_, Jan 02 2016