login
A266402
Self-inverse permutation of natural numbers: a(n) = A064989(A030101(A003961(n))).
4
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, 51, 28, 29, 18, 37, 76, 33, 22, 83, 24, 31, 16, 39, 40, 47, 42, 59, 46, 75, 44, 41, 218, 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
OFFSET
1,2
COMMENTS
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).
FORMULA
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
MATHEMATICA
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 *)
PROG
(PARI)
A030101(n) = if(n<1, 0, subst(Polrev(binary(n)), x, 2));
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
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)};
for(n=1, 8191, write("b266402.txt", n, " ", A266402(n)));
(Scheme) (define (A266402 n) (A064989 (A057889 (A003961 n))))
CROSSREFS
Cf. A265329, A266404 (other conjugates or similar sequences derived from A057889).
Cf. also A266401, A266415, A266416.
Sequence in context: A266641 A357977 A222258 * A266404 A265569 A265553
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jan 02 2016
STATUS
approved