This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A266402 #17 Jan 09 2016 14:27:26 %S A266402 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 A266402 51,28,29,18,37,76,33,22,83,24,31,16,39,40,47,42,59,46,75,44,41,218, %U A266402 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 A266402 Self-inverse permutation of natural numbers: a(n) = A064989(A030101(A003961(n))). %C A266402 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 A266402 Antti Karttunen, <a href="/A266402/b266402.txt">Table of n, a(n) for n = 1..8191</a> %H A266402 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A266402 a(n) = A064989(A030101(A003961(n))) = A064989(A057889(A003961(n))). %F A266402 Other identities. For all n >= 0: %F A266402 A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.] %t A266402 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 A266402 (PARI) %o A266402 A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2)); %o A266402 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 A266402 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 A266402 = n -> A064989(A030101(A003961(n))); %o A266402 for(n=1, 8191, write("b266402.txt", n, " ", A266402(n))); %o A266402 (Scheme) (define (A266402 n) (A064989 (A057889 (A003961 n)))) %Y A266402 Cf. A000035, A003961, A030101, A057889, A064989. %Y A266402 Cf. A265329, A266404 (other conjugates or similar sequences derived from A057889). %Y A266402 Cf. also A266401, A266415, A266416. %K A266402 nonn,base %O A266402 1,2 %A A266402 _Antti Karttunen_, Jan 02 2016