login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Permutation of nonnegative integers: a(n) = A057889(A243071(n)).
4

%I #9 Oct 06 2023 21:24:12

%S 0,1,3,2,7,6,15,4,5,14,31,12,63,30,11,8,127,10,255,28,23,62,511,24,13,

%T 126,9,60,1023,22,2047,16,47,254,27,20,4095,510,95,56,8191,46,16383,

%U 124,19,1022,32767,48,29,26,191,252,65535,18,55,120,383,2046,131071,44,262143,4094,39,32,111,94,524287,508,767,54

%N Permutation of nonnegative integers: a(n) = A057889(A243071(n)).

%H Antti Karttunen, <a href="/A366276/b366276.txt">Table of n, a(n) for n = 1..8192</a>

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

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%o (PARI)

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

%o A057889(n) = if(!n,n,A030101(n/(2^valuation(n,2))) * (2^valuation(n, 2)));

%o A243071(n) = if(n<=2, n-1, my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p*p2*(2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); ((3<<#binary(res\2))-res-1)); \\ (Combining programs given in A156552 and A054429)

%o A366276(n) = A057889(A243071(n));

%Y Cf. A057889, A243071, A366275 (inverse map), A366277 (fixed points of map n -> a(n)).

%K nonn

%O 1,3

%A _Antti Karttunen_, Oct 06 2023