login
a(n) = 1+A006068(A052331(n)).
2

%I #11 Apr 15 2018 15:05:43

%S 1,2,4,8,16,3,32,7,64,15,128,5,256,31,13,512,1024,63,2048,9,29,127,

%T 4096,6,8192,255,61,25,16384,14,32768,511,125,1023,17,57,65536,2047,

%U 253,10,131072,30,262144,121,49,4095,524288,509,1048576,8191,1021,249,2097152,62,113,26,2045,16383,4194304,12,8388608,32767,33,505,241,126

%N a(n) = 1+A006068(A052331(n)).

%C This is the inverse of A207901 if it is considered with a starting offset 1.

%H Antti Karttunen, <a href="/A302030/b302030.txt">Table of n, a(n) for n = 1..4096</a>

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

%F a(n) = 1+A302029(n) = 1+A006068(A052331(n)).

%o (PARI)

%o up_to_e = 8192;

%o v050376 = vector(up_to_e);

%o ispow2(n) = (n && !bitand(n,n-1));

%o i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));

%o A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };

%o A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ After code in A006068

%o A302030(n) = (1+A006068(A052331(n)));

%Y One more than A302029.

%Y Cf. A006068, A052331, A050376, A207901.

%K nonn

%O 1,2

%A _Antti Karttunen_, Apr 13 2018