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 A266407 #7 Jan 09 2016 16:08:58 %S A266407 1,2,5,3,4,17,11,10,9,7,6,19,13,8,21,31,34,71,29,22,61,25,20,59,41,18, %T A266407 73,23,14,33,43,12,53,37,38,35,15,26,67,47,16,157,107,42,145,55,62, %U A266407 197,69,68,179,113,142,129,39,58,191,137,44,45,49,122,227,101,50,199,151,40,121,57,118,211,89,82,111,149,36,91,85 %N A266407 Permutation of natural numbers: a(n) = A064989(A263273((2*n)-1)). %H A266407 Antti Karttunen, <a href="/A266407/b266407.txt">Table of n, a(n) for n = 1..9842</a> %H A266407 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A266407 a(n) = A064989(A263273((2*n)-1)). %o A266407 (PARI) %o A266407 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 A266407 A263273 = n -> if(!n,n,A030102(n/(3^valuation(n,3))) * (3^valuation(n, 3))); \\ Taking of the quotient probably unnecessary. %o A266407 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 A266407 A266407 = n -> A064989(A263273((2*n)-1)); %o A266407 for(n=1, 9842, write("b266407.txt", n, " ", A266407(n))); %o A266407 (Scheme) (define (A266407 n) (A064989 (A263273 (+ n n -1)))) %Y A266407 Inverse: A266408. %Y A266407 Cf. A064989, A263273. %Y A266407 Cf. also A064216, A266401, A266403. %K A266407 nonn,base %O A266407 1,2 %A A266407 _Antti Karttunen_, Jan 02 2016