login
Permutation of natural numbers: a(n) = (1/2) * (1+A263273(A003961(n))).
4

%I #6 Jan 09 2016 16:09:07

%S 1,2,4,5,3,11,10,14,9,8,7,32,13,29,37,41,6,26,12,23,15,20,28,95,22,38,

%T 115,86,19,110,16,122,30,17,36,77,34,35,55,68,25,44,31,59,60,83,40,

%U 284,61,65,100,113,33,344,46,257,70,56,24,329,21,47,289,365,88,89,39,50,49,107,18,230,27,101,244,104,112,164,82,203,174,74

%N Permutation of natural numbers: a(n) = (1/2) * (1+A263273(A003961(n))).

%H Antti Karttunen, <a href="/A266408/b266408.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) = (1/2) * (1+A263273(A003961(n))).

%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 A266408 = n -> (1+A263273(A003961(n)))/2;

%o for(n=1, 8191, write("b266408.txt", n, " ", A266408(n)));

%o (Scheme) (define (A266408 n) (/ (+ 1 (A263273 (A003961 n))) 2))

%Y Inverse: A266407.

%Y Cf. A003961, A263273.

%Y Cf. also A048673, A266401, A266403.

%K nonn,base

%O 1,2

%A _Antti Karttunen_, Jan 02 2016