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

%I #17 Jan 09 2016 14:27:26

%S 1,2,3,4,5,6,11,8,17,10,7,12,13,14,25,38,9,30,23,20,53,34,19,36,15,26,

%T 51,28,29,18,37,76,33,22,83,24,31,16,39,40,47,42,59,46,75,44,41,218,

%U 73,122,27,52,21,188,107,56,101,58,43,100,89,74,397,152,65,66,109,134,131,70,71,514,49,62,45,32,239,78,97,120,563,82,35

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

%C Shift primes in the prime factorization of n one step towards larger primes (A003961), then reverse the binary representation of the resulting odd number (with A030101), 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="/A266402/b266402.txt">Table of n, a(n) for n = 1..8191</a>

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

%F a(n) = A064989(A030101(A003961(n))) = A064989(A057889(A003961(n))).

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

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

%t f[n_] := Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose @FactorInteger@ n; g[n_] := FromDigits[Reverse@ IntegerDigits[n, 2], 2] 2^IntegerExponent[n, 2]; h[p_?PrimeQ] := h[p] = Prime[PrimePi@ p + 1]; h[1] = 1; h[n_] := h[n] = Times @@ (h[First@ #]^Last@ # &) /@ FactorInteger@ n; Table[f@ g@ h@ n, {n, 83}] (* A266402, after _Jean-François Alcover_ at A003961 and _Ivan Neretin_ at A057889 *)

%o (PARI)

%o A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2));

%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 A266402 = n -> A064989(A030101(A003961(n)));

%o for(n=1, 8191, write("b266402.txt", n, " ", A266402(n)));

%o (Scheme) (define (A266402 n) (A064989 (A057889 (A003961 n))))

%Y Cf. A000035, A003961, A030101, A057889, A064989.

%Y Cf. A265329, A266404 (other conjugates or similar sequences derived from A057889).

%Y Cf. also A266401, A266415, A266416.

%K nonn,base

%O 1,2

%A _Antti Karttunen_, Jan 02 2016